4 ms·
My biggest issue is wanting to bind ctrl/meta-x/c/v to do what you think they would do in my UI (a graph editor), but not do anything in input fields. I can sto
by meemoo 13y ago
My biggest issue is wanting to bind ctrl/meta-x/c/v to do what you think they would do in my UI (a graph editor), but not do anything in input fields. I can stopPropagation, but it is a pain to keep track of.
- renekooi 13y agoYou can attach an event to the window or some other higher-level element and check if event.target is an input field... something along the lines of: document.body.addEventListener('keydown', function(e) { if (e.target.tagName !== 'INPUT') doKeyBindings(); }, false);