mirror of
https://github.com/material-components/material-web.git
synced 2026-01-09 07:21:09 +08:00
Merge pull request #5758 from vdegenne:list-item-click
PiperOrigin-RevId: 721086401
This commit is contained in:
commit
ac916578a2
@ -203,4 +203,16 @@ export class ListItemEl extends listItemBaseClass implements ListItem {
|
||||
// work programmatically like in FF and select-option
|
||||
this.listItemRoot?.focus();
|
||||
}
|
||||
|
||||
override click() {
|
||||
if (!this.listItemRoot) {
|
||||
// If the element has not finished rendering, call super to ensure click
|
||||
// events are dispatched.
|
||||
super.click();
|
||||
return;
|
||||
}
|
||||
|
||||
// Forward click to the element to ensure link <a>.click() works correctly.
|
||||
this.listItemRoot.click();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user