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
Radix Select with Combobox instantly closes on Android #3274
Comments
@thgh, could you please tell me which device and OS you're using? |
Chrome on Android |
Alright, it could be an issue with Android, as I wasn't able to reproduce it on iOS. |
I debugged for a bit and found out that the React.useEffect(() => {
const close = () => onOpenChange(false);
window.addEventListener('blur', close);
window.addEventListener('resize', close);
return () => {
window.removeEventListener('blur', close);
window.removeEventListener('resize', close);
};
}, [onOpenChange]); |
Issue on Radix UI: radix-ui/primitives#2634 (thanks @georgekaran) The fix probably won't be merged soon, so it'd be great if we could figure out a way to fix it directly in the example. |
has anyone found any workarounds? |
This needs to be tested to ensure there are no unexpected side effects. But adding something like this to the component should work around the Radix issue: useEffect(() => {
const onResize = (event: Event) => {
event.stopImmediatePropagation();
}
window.addEventListener("resize", onResize);
return () => {
window.removeEventListener("resize", onResize);
}
}, []); |
Current behavior
On press, options appear and disappear.
Steps to reproduce the bug
Expected behavior
It should show options, with keyboard focused on search field
Workaround
#3274 (comment)
Possible solutions
#3274 (comment)
The text was updated successfully, but these errors were encountered: