Gameboy: focus the div after entering fullscreen
This commit is contained in:
parent
a317152e3f
commit
c17b193ca1
1 changed files with 7 additions and 1 deletions
|
@ -95,11 +95,17 @@ const Gameboy: React.FC<IGameboy> = ({ className, src, aspect = 'normal', onFocu
|
|||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (fullscreen) {
|
||||
node.current?.focus();
|
||||
}
|
||||
}, [fullscreen]);
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={node}
|
||||
tabIndex={0}
|
||||
className={clsx(className, 'relative')}
|
||||
className={clsx(className, 'relative outline-none')}
|
||||
onFocus={onFocus ?? handleFocus}
|
||||
onBlur={onBlur ?? handleBlur}
|
||||
>
|
||||
|
|
Loading…
Reference in a new issue