-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Describe the bug
Selection with a touch device has been implemented in different ways for different controls.
ListBoxItem
will select on touch release, as long as the touch ended withinIPlatformSettings.GetTapSize
pixels of its start point (even if the touch moved away and then came back)TabItem
will select on touch release, as long as the pointer didn't leave the item's header during the touchTreeViewItem
will select on touch begin
It is not possible to change any of this without creating a derived type and overriding its class event handler methods.
To Reproduce
Tap a ListBoxItem
, TabItem
, and TreeViewItem
with a touch device (or hack Avalonia so that a mouse pointer event leads to the touch device code).
Ideally remove any scroll viewers before testing, as these by default include a scroll gesture recogniser which can swallow input events and disrupt results.
Expected behavior
All three items should by default have the same behaviour. From experimenting with my devices, I can come up with three rules:
- Pressed effect when a touch begins
- Pressed effect removed when a gesture begins (e.g. scrolling)
- Item selected on touch release anywhere over the item, unless another gesture began
But one size doesn't fit all, so this behaviour should be customisable from the outside, without creating a derived class and overriding protected methods.
Avalonia version
11.3
OS
No response
Additional context
No response