This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/client/js/helpers/isIgnoredKeybind.js

13 lines
384 B
JavaScript
Raw Permalink Normal View History

"use strict";
export default (event) => {
if (event.target.tagName !== "TEXTAREA" && event.target.tagName !== "INPUT") {
return false;
}
// If focus is in a textarea, do not handle keybinds if user has typed anything
// This is done to prevent keyboard layout binds conflicting with ours
// For example alt+shift+left on macos selects a word
return !!event.target.value;
};