Fix menu focus bug

This commit is contained in:
Cory LaViska
2020-09-03 12:53:04 -04:00
parent 8b4507cf60
commit 0a5c4da2d1
2 changed files with 1 additions and 6 deletions

View File

@@ -4,6 +4,7 @@
- Fixed a bug where swapping an animated element wouldn't restart the animation in `sl-animation`
- Fixed a bug where the cursor was incorrect when `sl-select` was disabled
- Fixed a bug where clicking on `sl-menu` wouldn't focus it
- Updated `sl-animation` to stable
- Updated to Stencil 2.0 (you may need to purge `node_modules` and run `npm install` after pulling)
- Updated entry points in `package.json` to reflect new filenames generated by Stencil 2

View File

@@ -36,7 +36,6 @@ export class Menu {
this.handleClick = this.handleClick.bind(this);
this.handleFocus = this.handleFocus.bind(this);
this.handleKeyDown = this.handleKeyDown.bind(this);
this.handleMouseDown = this.handleMouseDown.bind(this);
this.handleMouseOver = this.handleMouseOver.bind(this);
this.handleMouseOut = this.handleMouseOut.bind(this);
}
@@ -162,10 +161,6 @@ export class Menu {
this.typeToSelect(event.key);
}
handleMouseDown(event: MouseEvent) {
event.preventDefault();
}
handleMouseOver(event: MouseEvent) {
const target = event.target as HTMLElement;
const item = target.closest('sl-menu-item');
@@ -192,7 +187,6 @@ export class Menu {
onFocus={this.handleFocus}
onBlur={this.handleBlur}
onKeyDown={this.handleKeyDown}
onMouseDown={this.handleMouseDown}
onMouseOver={this.handleMouseOver}
onMouseOut={this.handleMouseOut}
>