Skip to content

Commit

Permalink
fix Alt_[ for german MacOS
Browse files Browse the repository at this point in the history
SQUASHED: AUTO-COMMIT-src-client-lively.js,AUTO-COMMIT-src-components-widgets-lively-code-mirror-modes.js,
  • Loading branch information
JensLincke committed May 2, 2024
1 parent d860654 commit 6a95c0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/client/lively.js
Original file line number Diff line number Diff line change
Expand Up @@ -1985,6 +1985,11 @@ export default class Lively {
var shadowRoot = this.findParentShadowRoot(element)
if (shadowRoot) return shadowRoot.host
}

static isMacOS() {
return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);
}


static isActiveElement(element) {
var activeElemnt = this.activeElement();
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/lively-code-mirror-modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ class CodeMirrorModes {
}

// #KeyboardShortcut Alt-[ used in container to manipulate navbar
if (evt.key === '[' && (evt.altKey && !evt.ctrlKey && !evt.shiftKey)) {
if (evt.key === '[' && (evt.altKey && !evt.ctrlKey && !evt.shiftKey) && !lively.isMacOS()) {
evt.preventDefault();
evt.codemirrorIgnore = true;
}
Expand Down

0 comments on commit 6a95c0e

Please sign in to comment.