-
Notifications
You must be signed in to change notification settings - Fork 7
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
Adds support for Safari on iOS, fixes #17 #18
Conversation
Thanks a ton for taking care of that @kennethormandy! Not in the PC at the moment, but I will try to have a look and merge it tomorrow 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kennethormandy this approach is great, but I'm detecting a bit of flashing (basically the scrolling down being seen) on the behaviour, as those 100ms seems enough in CPU powerful enough devices for the scroll to go down and then get back. Paying attention, it can also be detected on you screen capture.
This flashing might not be ideal for the rest of cases of the polyfill, so we might need to just enable it for the iOS Safari cases, where this would be the price to pay for this to work.
Or, in my checks, a timeout value of 0 is also making this to work, while keeping the same behaviour for the rest of cases. Could you try it?
Thanks!
Good call, I’ve changed it to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏👏👏
Thanks @kennethormandy, this is now released as part of |
I was able to reproduce the issue described in #17 using Safari on iOS 13.
The support check seemed correct from my testing, and all that was missing was a timeout so
restoreScrollPosition
will happen afternativeFocus
.This PR adds a 100ms timeout, which fixes the issue. Some comments on this Stack Overflow post suggest that’s also necessary for older versions of IE.
I also updated the test case to add an input, which worked better as a test for touch devices. When the polyfill is working, the keyboard will open automatically.