WSA icon indicating copy to clipboard operation
WSA copied to clipboard

Drag/Scroll behaviours arnt registered if a TextInput has focus.

Open libbaz opened this issue 3 years ago • 2 comments

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

libbaz avatar Oct 21 '22 07:10 libbaz

Hi, could you please let us know the subsystem version number you're running?

hamza-usmani avatar Oct 21 '22 21:10 hamza-usmani

2207.40000.8.0

libbaz avatar Oct 21 '22 21:10 libbaz

We'll investigate and follow up on this. Thank you for bringing this to our attention!

hamza-usmani avatar Oct 25 '22 07:10 hamza-usmani

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)?

kevinkieselbach avatar Oct 25 '22 19:10 kevinkieselbach

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

libbaz avatar Oct 26 '22 04:10 libbaz

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.

kevinkieselbach avatar Nov 02 '22 22:11 kevinkieselbach

Fixed in Build 2211.

kevinkieselbach avatar Nov 02 '22 22:11 kevinkieselbach