I’m having a slight issue with keyboard focus within a ListBox.
Certiain rows on my list require the keyboard focus when they are selected. Imagine, for example, a slider on a row component that can be adjusted with left-right when the row is selected. In order to achieve this, the row component must grab the focus when it is selected. This works.
However, if the list is resized such that the viewport’s scrollbar becomes visible, it recieves the passed-out keypresses (ignored by the row component) instead of the listbox.
So, if a scrollbar is visible and i click on the list, i get one working up/down press (changing the row, and then giving focus to the new one) before the scrollbar recieves them. If that one step takes me to a row with a slider on it, the left/right works, but up/down control the scrollbar instead of row selection.
I guess I could get around it by specifically forwarding appropriate keys to the list component from the row component, but that’s not particularly elegant.
Any ideas on an alternative solution?