Hi,
Not setting SCR_ListBoxComponent::m_iCurrentItem when using SCR_ListBoxComponent::SetItemSelected is something intended or a bug?
I'm asking this because i'm preselecting the first item in the listbox after populating it. Although, after that if I select any other item (using cursor) the item that I've selected toggles to selected (thats ok) but the preselected item is still selected (visually).
As far as I've seen it is because OnItemClick needs m_iCurrentItem to be greater or equal than 0 to toggle it, and that happens only after the first selection using the cursor.
Description
Description
Details
Details
- Severity
- Tweak
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 10 x64
- Operating System Version
- Windows 10 Pro 21H2 (19044.2728)
- Category
- General
Steps To Reproduce
Video
https://youtu.be/Gz2zEcHinic
Test Project
Event Timeline
Comment Actions
Hi, thanks for the report and for the provided test project.
It's a bug indeed, we will fix it.
Until the fix is deployed, you can use this as a workaround:
modded class SCR_ListBoxComponent { override protected void _SetItemSelected(int item, bool selected, bool invokeOnChanged) { if (!m_bMultiSelection && selected) m_iCurrentItem = item; super._SetItemSelected(item, selected, invokeOnChanged); } }