scope icon indicating copy to clipboard operation
scope copied to clipboard

Cleanup shortcut handling

Open foot opened this issue 8 years ago • 3 comments

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?

foot avatar Oct 27 '16 16:10 foot

"don't trigger when term is focused" implemented in #1948

foot avatar Oct 27 '16 16:10 foot

@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 avatar Nov 02 '16 17:11 jpellizzari

@jpellizzari +1

fbarl avatar Nov 28 '16 17:11 fbarl