Merge pull request #17185 from Snuffleupagus/annotationLayer-modifier

Fix `WidgetAnnotationElement._getKeyModifier` to account for Linux
This commit is contained in:
Tim van der Meij 2023-10-28 14:21:19 +02:00 committed by GitHub
commit 238f3e728f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -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) {

View File

@ -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"),
});
}