Search code examples
angularjsui-gridangular-ui-typeaheadangular-ui-datepicker

uigrid is catching keyboard key events


Using AngularJs 1.x, I have a datepicker which should pick today when you press t. And I have ng-typeahead which should scroll down the options when keydown is pressed.

They both work fine when placed outside the ui-grid but when they are inside a cell of the grid. The datepicker's t stops working and if when using typeahead and pressing down it moves to the next row instead of scrolling through the options.

It seems that the grid is catching keyboard key events and messing up some directives. Is there a way to disable ui-grid event handlers when typing inside some cells?

My fellow colleague told me to write directives to handle those stuff but isn't there a simpler cell option? There should be a simpler way than writing 50 lines of code for that.


Solution

  • If you use Bootstrap Datepicker you can use its option datepicker-append-to-body. Newly created datepicker is appended directly to body element and should not mess with ui-grid's handlers.