[Glitch] fix: Fix unresponsive status banner button
Port 4d29215ad33958f445ea949c2dd2f1816c04ae79 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
19aa68897b
commit
bde8aa2781
@ -18,8 +18,13 @@ export const StatusBanner: React.FC<{
|
|||||||
|
|
||||||
const buttonRef = useRef<HTMLButtonElement>(null);
|
const buttonRef = useRef<HTMLButtonElement>(null);
|
||||||
const forwardClick = useCallback<MouseEventHandler>((e) => {
|
const forwardClick = useCallback<MouseEventHandler>((e) => {
|
||||||
if (buttonRef.current && e.target !== buttonRef.current) {
|
if (
|
||||||
|
buttonRef.current &&
|
||||||
|
e.target !== buttonRef.current &&
|
||||||
|
!buttonRef.current.contains(e.target as Node)
|
||||||
|
) {
|
||||||
buttonRef.current.click();
|
buttonRef.current.click();
|
||||||
|
buttonRef.current.focus();
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user