Bug 1902683 - Early return on keydown when screenshots button is focused. r=sfoster

Differential Revision: https://phabricator.services.mozilla.com/D213811
This commit is contained in:
Niklas Baumgardner
2024-06-15 13:40:07 +00:00
parent 22293a7ffb
commit 0f68e482f0
3 changed files with 24 additions and 1 deletions

View File

@@ -583,6 +583,10 @@ export class ScreenshotsOverlay {
this.maybeLockFocus(event);
return;
case "Enter":
if (this.handleKeyDownOnButton(event)) {
return;
}
if (this.hoverElementRegion.isRegionValid) {
this.draggingReadyStart();
this.draggingReadyDragEnd();
@@ -590,7 +594,10 @@ export class ScreenshotsOverlay {
}
// eslint-disable-next-line no-fallthrough
case " ": {
this.handleKeyDownOnButton(event);
if (this.handleKeyDownOnButton(event)) {
return;
}
if (Services.appinfo.isWayland) {
return;
}
@@ -1090,7 +1097,10 @@ export class ScreenshotsOverlay {
case this.downloadButton:
this.downloadSelectedRegion();
break;
default:
return false;
}
return true;
}
/**