Drag/Scroll behaviours arnt registered if a TextInput has focus.
Steps to reproduce
Many apps that have scrollable views become inoperable if the cursor enters a text input.
Can be reproduced with a simple jetpack compose view consisting of a TextField and scrollable column/view. The second view will be scrollable until the TextField takes cursor focus. Scroll functionality can only be resumed by shifting focus outside of the TextField (Ctr+Tab) then clicking outside the application, then bringing the application back into the foreground.
The same application running on an mobile device or AVD emulator doesnt suffer from the gesture swallowing and this seems locallised to WSA.
✔️ Expected Behavior
Drag/Scroll behaviours continue to function regardless of TextInput focus
❌ Actual Behavior
Drag/Scroll behaviours become inoperable after TextInput focus.
Other Software
No response
Have you specified the version of Windows Subsystem for Android under Milestone?
- [X] I have set this issue's milestone
Hi, could you please let us know the subsystem version number you're running?
2207.40000.8.0
We'll investigate and follow up on this. Thank you for bringing this to our attention!
For context, WSA typically emulates mouse input as touch input for application compatibility, but if a text field has focus, we temporarily disable the touch emulation to ensure text highlighting behaves appropriately. If you drag a finger in a text field on your phone, you'll notice it moves a magnified text cursor rather than highlighting the text, which isn't appropriate for mouse.
Therefore, it is expected that dragging with mouse to pan doesn't work while a text field has focus. However, we could probably fix scrolling while a text field has focus without impacting text highlighting since scroll input is handled separately from cursor input. Can you share a minimal repro app (either source or apk)?
I had an hour so I threw this demo together. Its a bit sloppy but it demontrates the issue well enough. https://github.com/libbaz/wsafocus-demo
Thanks for providing a repro. I updated WSA to enable our emulated touch scrolling while text fields have focus, which fixed scrolling in your scroll view while your text field is focused. This fix should be available in WSA preview builds early next year. In the meantime, you can make this scenario work by handling MotionEvent.ACTION_SCROLL events in your app.
Fixed in Build 2211.