Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Add preventDefault for global Finder shortcuts#146

Merged
hojberg merged 1 commit into
mainfrom
prevent-default-global-keyboard-events
Jun 8, 2021
Merged

Add preventDefault for global Finder shortcuts#146
hojberg merged 1 commit into
mainfrom
prevent-default-global-keyboard-events

Conversation

@hojberg

@hojberg hojberg commented Jun 8, 2021

Copy link
Copy Markdown
Member

Overview

Firefox has some clashes with the keyboard shortcuts of the Finder that
can't be prevented from within Elm (elm/browser#89); add a simple— slightly hackish—
event handler on the JavaScript side to preventDefault on the specific
Finder keyboard events.

Fixes: #136

Firefox has some clashes with the keyboard shortcuts of the Finder that
can't be prevented from within Elm; add a simple— slightly hackish—
event handler on the JavaScript side to preventDefault on the specific
Finder keyboard events.
@hojberg hojberg requested a review from pchiusano June 8, 2021 21:06
Comment thread src/CodebaseTree.elm
|> RemoteData.withDefault False

newModel =
-- TODO: Update to Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated removal of comment that wasn't relevant anymore.

window.addEventListener("keydown", (ev) => {
if (
ev.key === "/" ||
(ev.metaKey && ev.key == "k") ||

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meta is cmd on mac.

@hojberg hojberg merged commit 04aa4c6 into main Jun 8, 2021
@hojberg hojberg deleted the prevent-default-global-keyboard-events branch June 8, 2021 21:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On firefox, bringing up the finder using / works, but then also inputs a / into the text box

2 participants