Skip to content

Commit ac91657

Browse files
Merge pull request #5758 from vdegenne:list-item-click
PiperOrigin-RevId: 721086401
2 parents 767d1f1 + 1c60e56 commit ac91657

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

list/internal/listitem/list-item.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,16 @@ export class ListItemEl extends listItemBaseClass implements ListItem {
203203
// work programmatically like in FF and select-option
204204
this.listItemRoot?.focus();
205205
}
206+
207+
override click() {
208+
if (!this.listItemRoot) {
209+
// If the element has not finished rendering, call super to ensure click
210+
// events are dispatched.
211+
super.click();
212+
return;
213+
}
214+
215+
// Forward click to the element to ensure link <a>.click() works correctly.
216+
this.listItemRoot.click();
217+
}
206218
}

0 commit comments

Comments
 (0)