mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
Bugfix: prevent issue with modal dialog supported Esc
key to close
This commit is contained in:
parent
2627a16c36
commit
8cdce0c302
|
@ -62,9 +62,9 @@ export class AbstractViewPopup extends AbstractView
|
|||
shortcuts.add('escape,close', '', name, () => {
|
||||
if (this.modalVisible() && false !== this.onClose()) {
|
||||
this.close();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
// return true; Issue with supported modal close
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ const
|
|||
if (ViewTypePopup === position) {
|
||||
vm.close = () => hideScreenPopup(ViewModelClass);
|
||||
|
||||
// Firefox / Safari HTMLDialogElement not defined
|
||||
// Firefox < 98 / Safari < 15.4 HTMLDialogElement not defined
|
||||
if (!vmDom.showModal) {
|
||||
vmDom.classList.add('polyfill');
|
||||
vmDom.showModal = () => {
|
||||
|
@ -67,7 +67,19 @@ const
|
|||
vmDom.removeAttribute('open', null);
|
||||
vmDom.open = false;
|
||||
};
|
||||
/*
|
||||
shortcuts.add('escape', '', vm.keyScope.scope, () => {
|
||||
if (vmDom.open && false !== this.onClose()) {
|
||||
this.close();
|
||||
return false;
|
||||
}
|
||||
return true; Issue with supported modal close
|
||||
});
|
||||
*/
|
||||
}
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/cancel_event
|
||||
// vmDom.addEventListener('cancel', event => (false === vm.onClose() && event.preventDefault()));
|
||||
// vmDom.addEventListener('close', () => false !== vm.onClose());
|
||||
|
||||
// show/hide popup/modal
|
||||
const endShowHide = e => {
|
||||
|
@ -174,7 +186,7 @@ const
|
|||
|
||||
// Close all popups
|
||||
for (let vm of visiblePopups) {
|
||||
false === vm.onClose() || vm.close();
|
||||
(false === vm.onClose()) || vm.close();
|
||||
}
|
||||
|
||||
if (screenName) {
|
||||
|
|
Loading…
Reference in a new issue