Skip to content

Commit

Permalink
Ignore alt-key hotkeys in text fields
Browse files Browse the repository at this point in the history
Fixes mastodon#14862

This used to be the case until mastodon#13987, which introduced a hotkey to toggle
the Content Warning field.

Unfortunately, MacOS relies on the “alt” key for many things, including
composing text (see mastodon#14862), therefore, even if that makes the CW toggle
hotkey significantly less useful, it makes sense to not interfere with
composing toots.
  • Loading branch information
ClearlyClaire committed Oct 5, 2020
1 parent 5a9ad22 commit ca3872b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/javascript/mastodon/features/ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ class UI extends React.PureComponent {

componentDidMount () {
this.hotkeys.__mousetrap__.stopCallback = (e, element) => {
return ['TEXTAREA', 'SELECT', 'INPUT'].includes(element.tagName) && !e.altKey;
return ['TEXTAREA', 'SELECT', 'INPUT'].includes(element.tagName);
};
}

Expand Down

0 comments on commit ca3872b

Please sign in to comment.