mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-28 20:28:52 +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]);
|
useHotkeys(
|
||||||
|
'esc',
|
||||||
const [showMediaAlt, setShowMediaAlt] = useState(false);
|
onClose,
|
||||||
|
{
|
||||||
|
ignoreEventWhen: (e) => {
|
||||||
|
const hasModal = !!document.querySelector('#modal-container > *');
|
||||||
|
return hasModal;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
[onClose],
|
||||||
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let handleScroll = () => {
|
let handleScroll = () => {
|
||||||
|
|
Loading…
Reference in a new issue