Skip to content

Commit

Permalink
Merge pull request mozilla#17185 from Snuffleupagus/annotationLayer-m…
Browse files Browse the repository at this point in the history
…odifier

Fix `WidgetAnnotationElement._getKeyModifier` to account for Linux
  • Loading branch information
timvandermeij authored Oct 28, 2023
2 parents 3f0b3b1 + 069096e commit 238f3e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/display/annotation_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1018,8 +1018,7 @@ class WidgetAnnotationElement extends AnnotationElement {
}

_getKeyModifier(event) {
const { isWin, isMac } = FeatureTest.platform;
return (isWin && event.ctrlKey) || (isMac && event.metaKey);
return FeatureTest.platform.isMac ? event.metaKey : event.ctrlKey;
}

_setEventListener(element, elementData, baseName, eventName, valueGetter) {
Expand Down
3 changes: 1 addition & 2 deletions src/shared/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,9 @@ class FeatureTest {
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
typeof navigator === "undefined"
) {
return shadow(this, "platform", { isWin: false, isMac: false });
return shadow(this, "platform", { isMac: false });
}
return shadow(this, "platform", {
isWin: navigator.platform.includes("Win"),
isMac: navigator.platform.includes("Mac"),
});
}
Expand Down

0 comments on commit 238f3e7

Please sign in to comment.