[Glitch] Fix wrapstodon modal closing on any click
Port dfbf908870fcde76396ebccfb3d71ee1a06ffe82 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
183a42a5ee
commit
a56b739c68
@ -16,9 +16,15 @@ const AnnualReportModal: React.FC<{
|
|||||||
}, [onChangeBackgroundColor]);
|
}, [onChangeBackgroundColor]);
|
||||||
|
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const handleCloseModal = useCallback(() => {
|
const handleCloseModal = useCallback<React.MouseEventHandler<HTMLDivElement>>(
|
||||||
dispatch(closeModal({ modalType: 'ANNUAL_REPORT', ignoreFocus: false }));
|
(e) => {
|
||||||
}, [dispatch]);
|
if (e.target === e.currentTarget)
|
||||||
|
dispatch(
|
||||||
|
closeModal({ modalType: 'ANNUAL_REPORT', ignoreFocus: false }),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
[dispatch],
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// It's fine not to provide a keyboard handler here since there is a global
|
// It's fine not to provide a keyboard handler here since there is a global
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user