decai
Topic Author
Posts: 31
Joined: 06 Jul 2016, 18:19

[1.3 b3]ComboBox select wrong item

03 Nov 2016, 11:18

Hi,

We use version 1.3 beta3 and run Tutorial05 with ComboBox.xaml in the smaple.

1. We modify the first ComboBox added 13 items more. Then there will a scrollbar, we use the mouse wheel scroll to the last item "Item 17" and click left mouse to select it,
2016-11-03_180140.png
but "Item 8" will be selected
2016-11-03_180146.png
.
If we click the scrollbar scroll to the last item it will select right time.

2. In the first picture the ComboBox selector is larger than the main view, when the mouse position is outside the main view but inside the selector VisualTreeHelper::HitTest will return nullptr.


Thanks.
 
User avatar
sfernandez
Site Admin
Posts: 1911
Joined: 22 Dec 2011, 19:20

Re: [1.3 b3]ComboBox select wrong item

04 Nov 2016, 14:18

1. I found the bug, we were selecting the wrong item on mouse down when ComboBox had no focus. We will solve it for next release.

2. I don't understand, what do you mean for "larger than the main view"? Which visual are you passing as root in the VisualTreeHelper::HitTest call?
 
decai
Topic Author
Posts: 31
Joined: 06 Jul 2016, 18:19

Re: [1.3 b3]ComboBox select wrong item

04 Nov 2016, 16:24

Hi,

There is a new picture, we hope it will make the problem more clear.
2016-11-03_180140.png
2016-11-03_180140.png (94.83 KiB) Viewed 1922 times
As describe above, is that we should call VisualTreeHelper::HitTest using the ComboBox as root view? If so, the ComboBox is a child view of the main grid view, is that mean every time we do HitTest we should call VisualTreeHelper::HitTest for all child views of the parent view?

Thanks.
 
User avatar
sfernandez
Site Admin
Posts: 1911
Joined: 22 Dec 2011, 19:20

Re: [1.3 b3]ComboBox select wrong item

04 Nov 2016, 17:08

Every View has a Root visual that allows Popups and ToolTips to show over the rest of elements.
ComboBox drop down is added as a Popup to the View, so it is not a visual child of the ComboBox.

If you want to test if mouse is over any element of the UI (including Popups and ToolTips) you should do it this way:
VisualTreeHelper::HitTest(VisualTreeHelper::GetRoot(visual))
Where visual is any visual in the UI tree, for example the ComboBox.
 
decai
Topic Author
Posts: 31
Joined: 06 Jul 2016, 18:19

Re: [1.3 b3]ComboBox select wrong item

05 Nov 2016, 14:26

Got it. Thanks
 
User avatar
jsantos
Site Admin
Posts: 2899
Joined: 20 Jan 2012, 17:18
Contact:

Re: [1.3 b3]ComboBox select wrong item

11 Nov 2016, 21:47

Thanks for your detailed feedback!

Who is online

Users browsing this forum: No registered users and 0 guests