Merge pull request #269 from IBM/overflow-menu

fix(overflow-menu): focus menu button on escape key only
This commit is contained in:
Eric Liu 2020-09-21 08:49:11 -07:00 committed by GitHub
commit 9202a3e0e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,7 +125,6 @@
} }
if (didOpen && !open) { if (didOpen && !open) {
buttonRef.focus();
items.set([]); items.set([]);
currentId.set(undefined); currentId.set(undefined);
currentIndex.set(0); currentIndex.set(0);
@ -186,6 +185,7 @@
} else if (e.key === 'Escape') { } else if (e.key === 'Escape') {
e.stopPropagation(); e.stopPropagation();
open = false; open = false;
buttonRef.focus();
} }
} }
}}"> }}">