mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
Issue #2472 - Part 6: Fire cancel event and close modal <dialog> on [ESC]
This implementation is different than Mozilla, not indirectly queueing cancel tasks to be arbitrarily ordered, but rather synchronously close in reverse top layer order.
This commit is contained in:
parent
7d34b285e0
commit
87a7cf7332
6 changed files with 49 additions and 0 deletions
|
|
@ -8059,6 +8059,12 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent,
|
|||
aEvent->mFlags.mDefaultPreventedByChrome) {
|
||||
mIsLastChromeOnlyEscapeKeyConsumed = true;
|
||||
}
|
||||
if (aEvent->mMessage == eKeyDown &&
|
||||
!aEvent->mFlags.mDefaultPrevented) {
|
||||
if (nsIDocument* doc = GetDocument()) {
|
||||
doc->TryCancelDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue