mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-25 02:35:39 +03:00
Also fix esc handling media alt modal in media modal
This commit is contained in:
parent
81644e67bb
commit
8426a011b0
1 changed files with 11 additions and 3 deletions
|
@ -66,9 +66,17 @@ function MediaModal({
|
|||
};
|
||||
}, []);
|
||||
|
||||
useHotkeys('esc', onClose, [onClose]);
|
||||
|
||||
const [showMediaAlt, setShowMediaAlt] = useState(false);
|
||||
useHotkeys(
|
||||
'esc',
|
||||
onClose,
|
||||
{
|
||||
ignoreEventWhen: (e) => {
|
||||
const hasModal = !!document.querySelector('#modal-container > *');
|
||||
return hasModal;
|
||||
},
|
||||
},
|
||||
[onClose],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
let handleScroll = () => {
|
||||
|
|
Loading…
Reference in a new issue