-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
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
Affix doesn't update in iOS UIWebview #16202
Comments
What version of iOS are you using? |
iOS 8.2. You can reproduce the issue in Chrome for iOS |
Does http://stackoverflow.com/a/10880812 not work? |
That doesn't solve the issue. The view can scroll, it just doesn't fire any scroll events while it is going. This causes the affix to not "stick" until after scroll ends. |
Does WKWebView suffer from the same problem? |
No, I haven't tested it but from what I've read the WKWebview is similar to the native Safari in iOS 8.X and will throw scroll events while scrolling. This is only a a problem for UIWebview in iOS. |
Okay, have you tried https://poschel.wordpress.com/2013/08/29/uiwebview-javascript-scroll-events-in-ios-7/ ? |
@mhemesath Have you gotten a chance to try the other workaround I linked to above? |
Sorry, that didn't seem to work either. We are getting scroll events, just not until after scroll is over. I can try to throw together a test page that should be reproducible with Chrome on iOS (which uses webview I think). |
Can you post what the UIWebview uses as its user agent string? For comparison:
|
Mozilla/5.0 (iPhone; CPU iPhone OS 10_10_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12D508 |
So, my research didn't turn up any way to differentiate between UIWebView vs. WKWebView via JS. @fat What are your thoughts here, given the possible performance penalty of a touch event handler? |
I'm inclined not to add this directly into the plugin. Mobile scroll stuff has always been kinda jank and I'm a bit worried about potential sideeffects of adding the touchmove for all cases. Also, i feel better about passing on this because it seems like there are a couple of straightforward ways to get this behavior in your app – you could subclass Affix pretty simply or just write a quick little script to pipe touchevents through for your specific target/instance. |
Added a note about this to MDN: https://developer.mozilla.org/en-US/docs/Web/Events/scroll#iOS_UIWebView |
try use touchstart event on element and do nothing, but scroll events aren't fired when fingers leave the screen. |
Affix is no longer officially supported; see https://v4-alpha.getbootstrap.com/migration/#components |
In UIWebview scroll events aren't fired. This has the effect of making affix look buggy as its position isnd't updated until after scroll is done. To mitigate the effects of this, we could add a touchmove event listener to update the affix position when the user is scrolling via moving their finger.
The text was updated successfully, but these errors were encountered: