You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Blueprint is not tested for mobile usage, it is designed for desktop applications, so this is low priority for the project. Open to bugfix PRs, though.
I've had a look into this and found a couple of things
It seems that safari on iOS fires onChange events for select boxes when they are focused and blurred, even if the value doesn't change
-> Codesandbox here: https://codesandbox.io/s/hidden-hooks-y5k00?file=/src/App.js
Visit in iOS safari and tap each select box alternately, notice the console messages.
You'll also notice the value of the select box on screen changes when you focus it. On blur it returns to the correct value if you don't select a new one so it's not a huge deal and I don't think we can do much about it anyway but wait for a fix to safari/iOS.
This itself shouldn't result in a crash but the value for e.target safari passes with these change events in some cases (the case above) is an empty string, which results in an Invalid date and crash.
I'm not sure why we get an empty string sometimes as this doesn't happen in the codesandbox, perhaps someone with more knowledge of DatePicker can shed some light on it (maybe due to some of the custom focus/blur handling?)
A simple way to stop the crashes at least would be to just ignore the change event if the value passed is an invalid date or empty string. If this seems acceptable I can make a PR for it.
A simple way to stop the crashes at least would be to just ignore the change event if the value passed is an invalid date or empty string. If this seems acceptable I can make a PR for it.
Sure, I would accept a PR for this. Make sure to include a code comment about how this change is iOS-specific
Environment
Code Sandbox
Can be reproduced on Blueprint's site: https://blueprintjs.com/docs/#datetime/datepicker
Steps to reproduce
Actual behavior
Screen turns white, error
Expected behavior
I will see the month iOS scroll wheel and choose the appropriate month.
Possible solution
I believe this issue is related: #3603
The text was updated successfully, but these errors were encountered: