mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +03:00
Bugfix: prevent issue with modal dialog supported Esc key to close
This commit is contained in:
parent
2627a16c36
commit
8cdce0c302
2 changed files with 16 additions and 4 deletions
|
|
@ -62,9 +62,9 @@ export class AbstractViewPopup extends AbstractView
|
||||||
shortcuts.add('escape,close', '', name, () => {
|
shortcuts.add('escape,close', '', name, () => {
|
||||||
if (this.modalVisible() && false !== this.onClose()) {
|
if (this.modalVisible() && false !== this.onClose()) {
|
||||||
this.close();
|
this.close();
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
|
// return true; Issue with supported modal close
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ const
|
||||||
if (ViewTypePopup === position) {
|
if (ViewTypePopup === position) {
|
||||||
vm.close = () => hideScreenPopup(ViewModelClass);
|
vm.close = () => hideScreenPopup(ViewModelClass);
|
||||||
|
|
||||||
// Firefox / Safari HTMLDialogElement not defined
|
// Firefox < 98 / Safari < 15.4 HTMLDialogElement not defined
|
||||||
if (!vmDom.showModal) {
|
if (!vmDom.showModal) {
|
||||||
vmDom.classList.add('polyfill');
|
vmDom.classList.add('polyfill');
|
||||||
vmDom.showModal = () => {
|
vmDom.showModal = () => {
|
||||||
|
|
@ -67,7 +67,19 @@ const
|
||||||
vmDom.removeAttribute('open', null);
|
vmDom.removeAttribute('open', null);
|
||||||
vmDom.open = false;
|
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
|
// show/hide popup/modal
|
||||||
const endShowHide = e => {
|
const endShowHide = e => {
|
||||||
|
|
@ -174,7 +186,7 @@ const
|
||||||
|
|
||||||
// Close all popups
|
// Close all popups
|
||||||
for (let vm of visiblePopups) {
|
for (let vm of visiblePopups) {
|
||||||
false === vm.onClose() || vm.close();
|
(false === vm.onClose()) || vm.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (screenName) {
|
if (screenName) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue