fix(tooltip): pressing "Escape" should break out of trap focus (#1015)

Fixes #924
This commit is contained in:
Eric Liu 2022-01-17 13:40:10 -08:00 committed by GitHub
commit b13bb8e09f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,6 +75,7 @@
function onKeydown(e) {
if (e.key === "Escape" || e.key === "Tab") {
e.stopPropagation();
if (e.key === "Escape") refIcon?.focus();
open = false;
} else if (e.key === " " || e.key === "Enter") {
e.stopPropagation();