fix: color picker keyboard handling not working (#6464)

pull/6467/head
David Luzar 2 years ago committed by GitHub
parent d34cd3072f
commit 034113772d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -36,7 +36,13 @@ export const Popover = ({
return;
}
container.focus();
// focus popover only if the caller didn't focus on something else nested
// within the popover, which should take precedence. Fixes cases
// like color picker listening to keydown events on containers nested
// in the popover.
if (!container.contains(document.activeElement)) {
container.focus();
}
const handleKeyDown = (event: KeyboardEvent) => {
if (event.key === KEYS.TAB) {

Loading…
Cancel
Save