javascript - How to make keydown or keypress to be handled only by the current focused element -


i have sort of single web page app in have 2 different views (divs) displayed both in same time on page.

the first view has ui grid on navigation feature have eventlisteners keydown , keypress detect tab or arrow keys being pressed , navigate cell cell on grid.

in second view have form many fields , 1 of them textarea multiline input (see biography field in the md-input demo page). textarea needs navigation on lines while editing.

when arrow keys pressed both grid , textarea react , navigation occurs in both when textarea focused.

i have tried apply $event.stoppropagation(); , event.stopimmediatepropagation() on grid root element when textarea focused didn't work. possible prevent keydown , keypress handlers being executed in whole first view , let happen in second view ? how prevent happen in element , children ?


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -