mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
Base: Close settings dialogs when the escape key is pressed
This commit is contained in:
Notes:
github-actions[bot]
2026-02-12 23:30:23 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/0bfa5f3e529 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7917
@@ -585,7 +585,7 @@
|
||||
ladybird.sendMessage("restoreDefaultSettings");
|
||||
});
|
||||
|
||||
document.querySelectorAll("dialog").forEach(dialog =>
|
||||
document.querySelectorAll("dialog").forEach(dialog => {
|
||||
dialog.addEventListener("click", event => {
|
||||
const rect = dialog.getBoundingClientRect();
|
||||
|
||||
@@ -597,8 +597,14 @@
|
||||
) {
|
||||
dialog.close();
|
||||
}
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
dialog.addEventListener("keydown", event => {
|
||||
if (event.key === "Escape") {
|
||||
dialog.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
document.addEventListener("WebUILoaded", () => {
|
||||
ladybird.sendMessage("loadCurrentSettings");
|
||||
|
||||
Reference in New Issue
Block a user