Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoSelect weird behavior in virtualized SelectCombobox during Touch Events #3808

Closed
marilari88 opened this issue May 21, 2024 · 1 comment · Fixed by #3812
Closed

AutoSelect weird behavior in virtualized SelectCombobox during Touch Events #3808

marilari88 opened this issue May 21, 2024 · 1 comment · Fixed by #3812

Comments

@marilari88
Copy link

marilari88 commented May 21, 2024

Current behavior

Hi @diegohaz,

I'm encountering an issue when combining Ariakit's SelectCombobox with Virtua, specifically when autoSelect="true" is enabled. The functionality generally works well, but on mobile devices, I’ve noticed some unusual behavior.

Steps to Reproduce:

  1. Type into the combobox input.
  2. Attempt to scroll using a touch event.

Observed Behavior:
Scrolling becomes impossible because the focus repeatedly returns to the first auto-selected element, interrupting the scrolling action.

This issue is also present in the example with selectRenderer

Screenshots:

  1. autoSelect issue
  2. selectrenderer

Could you please look into this? Any guidance or fixes would be greatly appreciated.

Thank you!

Steps to reproduce the bug

https://stackblitz.com/~/github.com/marilari88/ariakit-virtua-select-combobox

Expected behavior

I expect to scroll through the filtered SelectItems smoothly, similar to the experience on non-touch devices.

Workaround

#3808 (comment)

Possible solutions

No response

@diegohaz
Copy link
Member

Thanks for the report! The best workaround I can think of right now is to disable autoSelect when you detect a touch device.

diegohaz added a commit that referenced this issue May 23, 2024
Closes #3808

I tried to write a test for it, but Playwright doesn't seem to support
scroll on touch move yet (related:
microsoft/playwright#2903).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants