scope
scope copied to clipboard
Cleanup shortcut handling
We have a single global shortcut handler in App
which is slowly accumulating exceptions:
- don't trigger when search is focused
- don't trigger when term is focused.
This is okay for now, and we don't have many shortcuts. But its getting messier.
What are best practices here?
- Ask browser if textarea/input has focus and don't trigger shortcut actions?
- textarea / input wrapper cmp should stop events bubbling to app if they have focus?
"don't trigger when term is focused" implemented in #1948
@foot We could do something like:
if (document.activeElement.type !== 'textarea' && document.activeElement.type !== 'input'){
// do shortcut stuff here
}
Then we wouldn't have to catch individual cases as we add more text inputs. Thoughts?
@jpellizzari +1