mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Fix wrapstodon modal closing on any click (#37209)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user