mirror of
https://github.com/mastodon/mastodon.git
synced 2025-12-17 09:33:16 +00:00
Fix wrapstodon modal closing on any click (#37209)
This commit is contained in:
parent
c06eb371e6
commit
dfbf908870
|
|
@ -16,9 +16,15 @@ const AnnualReportModal: React.FC<{
|
|||
}, [onChangeBackgroundColor]);
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
const handleCloseModal = useCallback(() => {
|
||||
dispatch(closeModal({ modalType: 'ANNUAL_REPORT', ignoreFocus: false }));
|
||||
}, [dispatch]);
|
||||
const handleCloseModal = useCallback<React.MouseEventHandler<HTMLDivElement>>(
|
||||
(e) => {
|
||||
if (e.target === e.currentTarget)
|
||||
dispatch(
|
||||
closeModal({ modalType: 'ANNUAL_REPORT', ignoreFocus: false }),
|
||||
);
|
||||
},
|
||||
[dispatch],
|
||||
);
|
||||
|
||||
return (
|
||||
// It's fine not to provide a keyboard handler here since there is a global
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user