From 0a5c4da2d1e828030fba2c0bf23c0ffb17f87bab Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Thu, 3 Sep 2020 12:53:04 -0400 Subject: [PATCH] Fix menu focus bug --- CHANGELOG.md | 1 + src/components/menu/menu.tsx | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f102107..33d835c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/components/menu/menu.tsx b/src/components/menu/menu.tsx index e6138bfd..4bbbc6a9 100644 --- a/src/components/menu/menu.tsx +++ b/src/components/menu/menu.tsx @@ -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} >