Listbox callback misfires: after double-click, SelectionType='open' persists and Enter/Arrow keys wrongly trigger plot actions.
6 views (last 30 days)
Show older comments
I am using a classic uicontrol('Style','listbox')–based GUI (not App Designer) that supports:
- Double-click → plot selected parameter
- Enter key → plot
- Arrow keys → only change selection
- Typed letters → incremental search
This behavior worked correctly in older MATLAB versions (up to R2024a), but in R2025a/b I see the following issue:Problem
After a double-click, the listbox callback is triggered again on the next keyboard event, and
SelectionType is still reported as 'open'.
Because of this:
- Arrow ↑/↓ after double-click plots again (unexpected)
- Enter sometimes plots twice
- It looks like 'open' “sticks” for one extra callback even though no mouse click occurred
Example callback pattern (simplified)
if isKeyEvent
if strcmp(eventData.Key,'return')
plot(...)
end
else
if strcmp(get(gcf,'SelectionType'),'open')
plot(...)
end
end
This logic still works in older MATLAB versions but produces incorrect behavior in R2025a/b due to the lingering 'open' state.Questions
- Is this a known issue or expected behavior?
- Is there a reliable way to detect a true double-click on a listbox in newer MATLAB versions?
- Should this be reported as a bug?
Any advice or workarounds would be appreciated.
0 Comments
Answers (0)
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!