-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Non-scrollable element with bind:clientHeight
and z-index
(iOS 14)
#5448
Comments
Just ran into this same exact issue as well... For some reason, in my specific case, this is also blocking scroll in Safari 14 on macOS Catalina. The workaround I'm considering is to use an empty div inside the resized element to measure width. Simple enough to work around I suppose, but pretty unexpected behavior... (Also, this looks like a duplicate of #5241...) |
I'm confused because the other issue says that it affects iOS12 and below, and this issue says iOS 14, and works fine below that. Not sure how this would be the same issue? |
@antony Yeah, my apologies, I'm a bit confused as well... Both issues appear to be caused by to the iframe's z-index layering above sibling elements, and both issues involve Safari. In my specific case, I'm observing the behavior on macOS Catalina in Safari 14 as well as the iPhone simulator in Xcode 12.2. I've confirmed that setting the z-index of the iframe to -1 (as suggested in #5241) does fix this problem. I'm having trouble replicating the behavior in the REPL however... Hope to have more information soon. |
FWIW, It does appear that the iframe Not sure why it changed there, do you have context around that @mrkishi / @Conduitry? |
Okay, after much frustration, I've figured out how to repro this. Steps I took to verify:
Again, I'm observing this behavior in Safari 14.0.1 on macOS Catalina 10.15.7. What's even stranger is that, if you have "Show scroll bars: Always" in System Preferences, you can actually still use the scrollbar to scroll, but not the trackpad. I believe this issue at its core is the same issue that @crotru identified in #5241. As he put it:
So the original |
Same issue indeed that #5241 indeed. To put it in another words : iframe can't take Z-index are scoped to their dom-level. so in this case
children will be over parent2 but in this case :
parent2 will be above children So having the Iframe (which is a children) to have a z-index value of [parent z-index minus 1] doesn't do anything good 🙂
|
I don't have an iOS device to test this on, but this should be fixed now in 3.31.1, which includes @nick-vincent's |
Describe the bug
Using
bind:clientHeight
on an element withz-index
prevents that element's contents from being scrolled on iOS 14. On previous versions of iOS and on other OS's, this bug does not appear.The iframe added by
add_resize_listener
specifies az-index
that is 1 less than the element'sz-index
, as well aspointer-events: none
. Perhaps this is connected...Logs
N/A
To Reproduce
I've made a small REPL with a simplified version of the environment this occurred in for us at Playpilot (in our top navigation): https://svelte.dev/repl/695f80e7948e4575b6e1f0fd536716fb?version=3.26.0
Expected behavior
The
z-index
should not make a difference to whether you can scroll or not (as on other platforms/OS versions).Information about your Svelte project:
Your browser and the version: Safari, Chrome, Firefox (tested various browsers)
Your operating system: iOS 14 (it works fine for previous versions of iOS, as well as other OS's)
Svelte version: 3.26.0
Bundler: Rollup
Severity
Just a bit annoying. It was quite a mystery in the beginning, but once we found the issue, solving it was relatively simple: we just wrapped the content of the element in a div with
position: relative;
plus the samez-index
as the element itself and it works fine. Of course we would like to remove this once the bug is fixed, but for now this is not pressing.The text was updated successfully, but these errors were encountered: