mirror of
https://github.com/material-components/material-web.git
synced 2024-08-17 09:30:27 +03:00
fix(select): clicking select toggles the menu rather than just open
PiperOrigin-RevId: 595540752
This commit is contained in:
parent
89427158b7
commit
043bbad6f3
@ -57,6 +57,16 @@ export class SelectHarness extends Harness<Select> {
|
||||
}
|
||||
(await this.getItems()[index].getInteractiveElement()).click();
|
||||
}
|
||||
|
||||
get isOpen() {
|
||||
const menu = this.element.renderRoot.querySelector('md-menu')!;
|
||||
if (!menu) {
|
||||
throw new Error(
|
||||
'Internal md-menu is not found. md-select may not have finished rendering when isOpen has been checked',
|
||||
);
|
||||
}
|
||||
return menu.open;
|
||||
}
|
||||
}
|
||||
|
||||
// Private class (not exported)
|
||||
|
@ -575,7 +575,7 @@ export abstract class Select extends selectBaseClass {
|
||||
}
|
||||
|
||||
private handleClick() {
|
||||
this.open = true;
|
||||
this.open = !this.open;
|
||||
}
|
||||
|
||||
private handleFocus() {
|
||||
|
Loading…
Reference in New Issue
Block a user