Ran into this in an app I have been working on... originally suspected a far less obscure/rare edge case than this ends up being.
Steps:
Remove an item from a grid's store while the grid is not focused
Immediately (on the same turn) call grid.focus()
The content node ends up being focused instead of a neighboring row
This happens because _restoreFocus gets fooled - since the grid wasn't focused when _removedFocus was populated, its active flag is false, but then when focus gets called, _focusedNode is null because _restoreFocus only gets called on next turn for the removal case (in order to allow re-insertion of the same item to take precedence). Since active is false, _restoreFocus doesn't properly reset active focus.
This might be resolvable as simply as flipping the active flag if focus gets called while _removedFocus is set.
Ran into this in an app I have been working on... originally suspected a far less obscure/rare edge case than this ends up being.
Steps:
grid.focus()
This happens because
_restoreFocus
gets fooled - since the grid wasn't focused when_removedFocus
was populated, itsactive
flag isfalse
, but then whenfocus
gets called,_focusedNode
is null because_restoreFocus
only gets called on next turn for the removal case (in order to allow re-insertion of the same item to take precedence). Sinceactive
isfalse
,_restoreFocus
doesn't properly reset active focus.This might be resolvable as simply as flipping the
active
flag iffocus
gets called while_removedFocus
is set.Repro: