pharo
pharo copied to clipboard
DropDown List selects another item when clicked
Describe the bug When click on a dropdown list, do scroll and select an item doing click, the selected item is not the one clicked.
To Reproduce I found this error by loading extra themes and trying to change them:
1.- Load extra themes:
Metacello new
repository: 'github://David5i6/Uncommon-Themes/src';
baseline: 'UncommonThemes';
load
2.- On the setting change the theme
3.- Sometimes when clicked on a theme, another one is selected
Expected behavior When click on an element of the dropdown box, this element should be the one selected
Version information:
- OS: Window 10 (also tested on Mac OSX Catalina)
- Version: Pharo-9.0.0+build.410.sha.f1626bf6621b3855ce25b3c36db8904015c41647 (64 Bit) (I've also noticed that on earlier versions of pharo 9)
Hi david you are talking about morphic. By any chance do you have a code snippet illustrating the problem?
S
Sorry, I've no code for that. I found the bug when selecting themes on the Pharo Settings. I was testing a little more and narrowed theproblem. It seems to be related with the scroll. When The dropdown list is big enough to do scroll and you scroll down (with nouse wheel or directly clicking and draggind the scroll bar on the right) the do click on an element, the selected one is the element in that was under mouse pointer before scrolling. It seems that the scroll is not taken into account when computing wich element is selected.
Finally I've got some time to look into the bug. I've loaded a pletora of themes, and put a breackpoint into the dropListMorph -> listMouseDown.
For some reason when I select a theme It's called twice but the real problem is that the first call returns the correct theme while the second seems to not hace the scroll into account.
Also after some more debugging, It seems that it's even a worst case because the theme is changed before this breackpoint, so theme seems to change 3 times or more.
I've to try to look further to discover what's really happening, but surely help (and time) will be needed.
Thanks a LLLLOOOOOOTTTTT
Because I already discussed that we are creating far too many points and you are showing me the proof of that.
We hate the theme code and we want to clean it. So if you see any point to clean let us know. I did some benchs by redefining new in Point
Point class>>new super new. '.' trace.
And to me there are far too many points changed but my crew here was telling me that this is normal and I do not believe it.
Of course I'll tell if I see something ;-) Thanks !
Hi, I don't know if this helps but I've found that the event is processed twice, form the event handling and from a subscription. Attached is a screenchot showing that.
Wish this could help..