Skip to content
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

iOS - Sticky toolbar does not stick #223

Closed
nickvelloff opened this issue Feb 25, 2016 · 8 comments
Closed

iOS - Sticky toolbar does not stick #223

nickvelloff opened this issue Feb 25, 2016 · 8 comments

Comments

@nickvelloff
Copy link

iPhone 6s Plus, iOS 9.2.1, PM version 0.4.0

Expected result:
Toolbar stays visible and fixed upon scrolling.

Actual result:
Toolbar becomes invisible and blinks off and on upon scrolling.

ed-bug-scroll-2

@marijnh
Copy link
Member

marijnh commented Feb 26, 2016

Safari is the new IE, as they say.

One problem here is that my scroll handler (which determines when menubar is leaving the viewport and should be floated) is only called after the whole scroll finishes, rather than, as it is on desktop browsers, repeatedly during scrolling. So it can't really do its job in this case.

But sometimes the bar ends up in a bogus position (200-500 pixels above the viewport), even after scrolling has finished. Its css says position: fixed and top: 0 in this case, so that's just Safari being broken about positioning.

I think these are bad enough to recommend not enabling a floating menubar on mobile Safari. I could find lots of talk about these issues online, but no workaround — the general recommendation was not to rely on position: fixed in Mobile Safari.

@nickvelloff
Copy link
Author

@marijnh Thanks for looking into it. We were hoping we could perhaps use it in a version 1 but it looks like we will need to take it all the way to a native toolbar out of the gate.

@forresto
Copy link
Contributor

The workaround 🙈 seems to be doing a manual fixed implementation with debounced scroll event and absolute positioning. It isn't pretty, but the native tooltip is even less workaroundable.

I could try to make a PR to move my fix upstream. Should it sniff mobile safari?

@marijnh
Copy link
Member

marijnh commented Feb 29, 2016

Don't debounced scroll events produce a very noticeable and annoying jittering of the positioned element? Especially on mobile, where scroll events arent fired immediately, the thing will be scrolled far out of view and then snap back.

@forresto
Copy link
Contributor

You're right, that debounce was premature optimization. It's smoother and better without. Still a bit jittery.

@marijnh
Copy link
Member

marijnh commented Feb 29, 2016

I am surprised you're able to get anywhere near smooth with that technique. But if you can turn it into a relatively functional fallback that the module uses on iOS, I'd definitely be interested in a patch.

@nickvelloff
Copy link
Author

@marijnh - we hacked in a solution that really does not work very well. We will go native toolbar on this for the time being.

@marijnh
Copy link
Member

marijnh commented Dec 9, 2016

Moved to ProseMirror/prosemirror-menu#3

@marijnh marijnh closed this as completed Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants