fix(overflow-menu): focus menu button on escape key only

Fixes #268
This commit is contained in:
Eric Liu 2020-09-19 09:47:11 -07:00
commit 93da919951

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();
} }
} }
}}"> }}">