Clicking on the dropdown field does not fire onClick events added to window when on mobile
Description of the issue:
When on mobile (either a real device or simulated with Chrome Dev Tools) click events aren't triggered when clicking on the dropdown input.
Steps to reproduce the issue:
- Go to: https://react-select.com/home (because any dropdown from react-select will work for that)
- Open DevTools, go to Console and type in
window.addEventListener('click', () => console.log('clicked')); - Click on the icon found in the top left corner to simulate a mobile device
- Click on a dropdown - no log will be visible in the console
Clicking someplace else or disabling mobile device simulation will produce logs after clicking on the dropdown.
Expected result:
When on mobile, a click on the dropdown input should produce a log in the console. The log is just an example, of course.
Same issue here. Any updates?
In case anyone has been able to resolve the issue or find a solution, I would much appreciate the help. Some parts of my team's development have been blocked because of this problem. We have been using this library quite extensively, thus dropping it would mean rebuilding a lot of our search fields across the website from scratch.
This issue is causing a lot of challenges on my end. please provide us a solution
is it possible that this issue is being caused because we are using class component instead of functional component
Hey guys! this maybe be an expected behavior. Instead of listening to "click" event, on mobile you can listen to "touchstart" event on mobile. You can achieve the same thing, but this is not going to work on desktop though. Maybe you have to do both.
Ex:
window.addEventListener('touchstart', () => console.log('clicked touch'));
window.addEventListener('click', () => console.log('clicked'));
So, this may be not a bug, what're your thoughts ?