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
merged 1 commit into from
Jun 8, 2021

Conversation

hojberg
Copy link
Member

@hojberg hojberg commented Jun 8, 2021

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
@@ -86,7 +86,6 @@ update env msg model =
|> RemoteData.withDefault False

newModel =
-- TODO: Update to Loading
Copy link
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
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