Mobile Safai doesn't close when tapping outside the control
See original GitHub issueWhen using an iPad or iPhone, clicking outside the opened flatpickr does not close it.
Expected Behavior
It should close.
Current Behavior
It doesn’t close.
Possible Solution
In the bind()
method, document.addEventListener("click", documentClick);
does not work on non-link elements in mobile Safari (see http://stackoverflow.com/questions/3705937/document-click-not-working-correctly-on-iphone-jquery). A possible solution could be when the control opens on a mobile device to add a class to the body, the class would contain cursor: pointer;
to work around the issue (might need to add this to an invisible overlay between the page and the control…)
Steps to Reproduce (for bugs)
- Open flatpickr on an iPad
- Click on a part of the page outside of flatpickr.
- Flatpickr does not close as expected.
Context
It makes using the control on an iPad a bit frustrating.
Your Environment
- Version used: 2
- Browser Name and version: Mobile Safari
- Operating System and version (desktop or mobile): iOS 10
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Open and close tabs in Safari on iPad - Apple Support
Close tabs. Tap the Tabs button , then tap the Close button in the upper-right corner of a tab to close it.
Read more >Open and close tabs in Safari on iPhone - Apple Support
Tip: To close all tabs in this Tab Group at the same time, touch and hold Done, then tap Close All Tabs. Open...
Read more >Customize your Safari settings on iPad - Apple Support
Use the Page Settings button to switch to Reader, hide the search field, set privacy controls for a website, and more. Tap the...
Read more >Block pop-up ads and windows in Safari - Apple Support
Learn how to block pop-up windows and handle persistent ads on your iPhone, iPad, or Mac.
Read more >Clear the history and cookies from Safari on your iPhone, iPad ...
Delete history, cache, and cookies ... To clear your history and cookies, go to Settings > Safari, and tap Clear History and Website...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I can confirm that in Flatpickr v2.3.4 this issue is present on mobile Safari on iOS 10.
Kindly re-open the issue if any problems still persist. Thank you