Skip to content Skip to sidebar Skip to footer

Ie 11 Select With Focus Losing Focus When Clicked

I'm making a spreadsheet where double-clicking a cell brings up the 'edit' control, gives it focus, and sets up an onblur event handler to hide the 'edit' control and set the value

Solution 1:

Found a solution. Turns out it was all input/select type nodes were losing focus, and what was happening was that the nodes that were in a table would, when clicked, bubble the event from the control to the table cell, which would then get focus and cause blur() to trigger on the internal control. The solution was to hook up event handlers for onclick, onmousedown, and onmouseup (for good measure) that do nothing but preventDefault() and stopPropagation(). Once the event stopped propagating to the containing table cell, everything worked as it should.

Solution 2:

Instead of calling focus directly call it using settimeout (), an interval of 1 to 10 ms should be enough.

Post a Comment for "Ie 11 Select With Focus Losing Focus When Clicked"