03-06-2024 03:18 PM
I found an unexpected behavior when navigating a listbox using the arrow keys. Items whose symbols are divider lines, and are thus not selectable, are included in the arrow navigation, but without visual feedback.
This is in contrast to other non-selectable items in the listbox, which are not skipped in keyboard navigation, but are highlighted (differently, with a gray outline) than selected items, so that there is visual feedback.
The preferred behavior for divider lines would be to skip dividers in keyboard navigation.
Thoughts?
03-06-2024 05:32 PM
Does this apply to all styles of listbox? Modern, NXG, Silver, Classic, System?
03-18-2024 12:01 PM - edited 03-18-2024 12:15 PM
It is easy to show that this is the behavior across all types, as shown in the attached VI. Notice it also occurs on multi-column listboxes. In all cases, if you start on item a, the first click activates the divider row without feedback, and the second click shows you on item c. Hard to believe this behavior has existed in LabVIEW for so long.
Is there an instance where keyboard navigation to a divider line would make sense? It does appear that the symbol and value of the divider-line item is not available for programmatic processing, as shown in the example.
12-04-2024 01:02 PM
I have requested this to be fixed in the Idea Exchange. Go vote for it!
12-04-2024 04:49 PM
Maybe you should save the example in an older LV version so more people can examine it?
I don't think I have ever used a list box before in my 25+ years of programming in LV 🤔
12-04-2024 05:02 PM - edited 12-04-2024 05:03 PM
I was too curious about this behavior, so I looked up the LV example (C:\Program Files (x86)\National Instruments\LabVIEW 2020\examples\Controls and Indicators\Listbox\Listbox.vi) and inserted a separator. When using the arrow keys, the separator appears to "eat" the arrow-key press IE the separator does not get highlight as report in the OP. This was during dev mode. I did not explore if it behaved the same during run-time.
12-04-2024 05:18 PM
It does the same at runtime, and as you have found, it is an easy thing to demonstrate.
There's another weird issue, which is that if you arrow down to a disabled listbox item, it will be hi-lighted (with a gray box I believe), but if you set the value programmatically it will not get hi-lighted, so there's no visual feedback about the selection.
I use listboxes a lot, such as in the BundleMagic plugin, which makes extensive use of them in cluster element, method, property, and class selection dialogs. I'm also writing an application now that uses listboxes to allow selection/display of test modes for the device under test.