Open JanSkvaril opened 1 week ago
We switch focus to an input element on pointer pressed. This is expected behavior on desktop, but on mobile it causes focus to change on any gesture start. There are few controls/widgets that are actually focusable by touch on mobile, and focus is expected to change only when a gesture is complete(like the hold gesture) or when the pointer is released.
Thank you for the clarification. Is there a possible solution or workaround? Are there any plans to improve this behavior in the future?
Describe the bug
While working on an Android app, we discovered an issue with the ScrollViewer and input controls (e.g., textboxes). The input controls are being focused when dragging the screen to scroll. In larger forms, this is especially unpleasant, as users often accidentally press other textboxes/inputs while scrolling.
To Reproduce
A simple way to reproduce this issue is to add a large number of textboxes to the ScrollViewer:
I am also attaching a minimal reproduction project and a video demonstrating the issue. In this project, it is impossible to scroll down without activating the textbox. AvaloniaScrollInputs.zip
https://github.com/user-attachments/assets/4e74bd13-d8ec-4f4c-8553-ca10143c8e5d
Expected behavior
The textboxes should not be focused while scrolling on a touch device.
Avalonia version
11.1.3
OS
Android
Additional context
No response