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

Safari Controls disappearing under TileLayer #8068

Closed
siimots opened this issue Mar 15, 2022 · 29 comments
Closed

Safari Controls disappearing under TileLayer #8068

siimots opened this issue Mar 15, 2022 · 29 comments
Labels
bug compatibility Cross-browser/device/environment compatibility ios mobile won't fix

Comments

@siimots
Copy link

siimots commented Mar 15, 2022

Note: The WebKit bug has been fixed. For workarounds, see this comment.

Latest iOS 15.4 created strange bug of disappearing controls in Leaflet 1.6.0 when panning around map.

Half missing controls

Expected behavior
Controls should stay above tile layer

Current behavior
Controls get hidden under tile layer when panning around

Environment

  • Leaflet version: 1.6.0
  • Browser (with version): iOS 15.4 Safari
  • OS/Platform (with version): iOS 15.4

Additional context
Bug does not appear in Android Chrome or Windows desktop browsers.
Also worked fine in iOS 15.3.x and previous versions.

Minimal example reproducing the issue
My app: https://gis.ee/meri/
Video: https://i.imgur.com/Uu6H8pR.mp4

Safari bugs are quite difficult to debug and probably it will get fixed in future iOS.
This bug report is mostly just for information, hopefully Safari gets some bugfixes soon.

@IvanSanchez
Copy link
Member

Please try with 1.8.0-beta.0.

@siimots
Copy link
Author

siimots commented Mar 15, 2022

I discovered that problem appears only when there are a lot of div icons.

Same glitches in 1.8.0-beta.0 also.

Maybe 15.4 safari crashes when there are too many dom elements but it was not problem in 15.3 safari.
Safari is frustrating :(

@TurtIeSocks
Copy link

TurtIeSocks commented Mar 31, 2022

Any luck with this? Or anything I can help troubleshoot? My issue on React Leaflet mentioned above includes a minimum codebase to reproduce, if that helps.

@siimots
Copy link
Author

siimots commented Mar 31, 2022

I guess we have to wait for iOS 15.4.1 not much to do here.
I have submitted bug report at Apple Feedback Assistant.
Maybe you can submit it too with your app url so they know it is problem for many users.

https://feedbackassistant.apple.com/

@Falke-Design
Copy link
Member

@TurtIeSocks yes we need to wait for the next IOS release. No one of the maintainers has an IOS Phone. If it is a long term problem, we need to look for a solution

@siimots
Copy link
Author

siimots commented Apr 4, 2022

iOS 15.4.1 did not fix it.

But now I tested with new beta release v1.8.0-beta.3 and now controls don't get hidden under tile layer.
#8102 maybe it fixed it?

Edit: Celebrated too early. 5 minutes of panning around and finally problem appeared again.

image

@plotaroute
Copy link

We've had a few users reporting this issue too with our route planners, using Safari 15.4 on both desktop and mobile:

Desktop: https://www.plotaroute.com/routeplanner
Mobile: https://www.plotaroute.com/mobile/routeplanner

We haven't been able able to reproduce it though, so it does seem to be very intermittent and dependent on some set of circumstances that we haven't yet been able to identify.

Any more clues as to what the trigger is or how to workaround the problem? For example, if it's a corrupt zIndex issue, would it be possible to check zIndex of the controls after after the map has been dragged to ensure that it is higher than the zIndex of the tile layer?

@siimots
Copy link
Author

siimots commented Apr 5, 2022

Any more clues as to what the trigger is or how to workaround the problem? For example, if it's a corrupt zIndex issue, would it be possible to check zIndex of the controls after after the map has been dragged to ensure that it is higher than the zIndex of the tile layer?

I changed controls z-index to 999999 manually in safari developer tools (usb connection to phone) and controls still stayed under tile layer.

@siimots
Copy link
Author

siimots commented Apr 5, 2022

Webkit Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=238589

@Falke-Design
Copy link
Member

We've had a few users reporting this issue too with our route planners, using Safari 15.4 on both desktop and mobile:

@mourner can you test it on your mac?

I tested it with the example from the tutorial on a IPhone and it happened too.
I didn't find a step by step instructions to reproduce but mostly it happened after zooming fully out and zooming / moving while loading. Maybe we have more luck with debugging on a mac.

@jonkoops jonkoops added bug mobile compatibility Cross-browser/device/environment compatibility ios labels Apr 6, 2022
@TurtIeSocks
Copy link

We've had a few users reporting this issue too with our route planners, using Safari 15.4 on both desktop and mobile:

mourner can you test it on your mac?

I tested it with the example from the tutorial on a IPhone and it happened too.
I didn't find a step by step instructions to reproduce but mostly it happened after zooming fully out and zooming / moving while loading. Maybe we have more luck with debugging on a mac.

I couldn't reproduce on a Mac but back when I first opened the React Leaflet issue, I hooked up a 15.4 iPad to a Mac and opened up the dev tools. My best guess is that the bug/issue is related to the new Cascade Layers.

https://webkit.org/blog/12445/new-webkit-features-in-safari-15-4/

You can open up the new layers dev panel and see UI components going in and out as you pan/zoom around a Leaflet map.

@plotaroute
Copy link

plotaroute commented Apr 14, 2022

We think we may have found a workaround for this. As it's an intermittent problem we can't be 100% sure, but after adding the following css to the page the problem seemed to go away:

.leaflet-control-container .leaflet-top, .leaflet-control-container .leaflet-bottom {
	transform: translate3d(0px, 0px, 0px);
}

We have a few other DOM elements (outside of the leaflet map container) that are positioned above the map, so we had to add the same transform css for these too.

@siimots
Copy link
Author

siimots commented Apr 14, 2022

Thank you!

@plotaroute, can you make PR for it. I think it great simple fix.
Looks like there will be 1.8.0 release soon, so it would be nice to have it included.

@Falke-Design
Copy link
Member

@Malvoz I don't find the link anymore, but I mean that you shared a blog from opera dev about will-change where a workaround was transform: translate3d(0px, 0px, 0px); too. Can you please link it again?

@Malvoz
Copy link
Member

Malvoz commented Apr 14, 2022

@Falke-Design from #8044 (reply in thread):
https://dev.opera.com/articles/css-will-change-property/#the-old-the-translatez-or-translate3d-hack

@Falke-Design
Copy link
Member

@Malvoz Thank you! I searched 15 minutes ... 😄

@plotaroute can you please try to use:

will-change: transform;

@Falke-Design

This comment was marked as outdated.

@Malvoz
Copy link
Member

Malvoz commented Apr 23, 2022

The WebKit bug (#8068 (comment)) was fixed 2022-04-20.

Confirmed workarounds include:

@Falke-Design suggests:

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
  will-change: transform;
}

Optionally, see #8068 (comment) to target Safari only.

@Falke-Design
Copy link
Member

The WebKit bug (#8068 (comment)) was fixed 2022-04-20.

@Malvoz I suggest to add won't fix , what do you think?

@Malvoz Malvoz closed this as completed Apr 23, 2022
@Falke-Design Falke-Design changed the title iOS 15.4 controls hidden under tile layer Safari Controls disappearing under TileLayer Apr 23, 2022
@Falke-Design Falke-Design pinned this issue Apr 23, 2022
@simonneutert
Copy link

@Falke-Design thank you very much for the hint given 🚀
It fixed the disappearing overlays and buttons I had to struggle with 👏

@siimots
Copy link
Author

siimots commented May 17, 2022

The WebKit bug (#8068 (comment)) was fixed 2022-04-20.

@Malvoz I suggest to add won't fix , what do you think?

iOS 15.5 was just released and it did not fix this problem. Maybe css will-change fix is needed in Leaflet CSS?

@Malvoz
Copy link
Member

Malvoz commented May 22, 2022

iOS 15.5 was just released and it did not fix this problem.

File a new WebKit bug? Or ask in the existing one?

Maybe css will-change fix is needed in Leaflet CSS?

Simultaneously people are asking to remove will-change.

@aabdolla
Copy link

If it is removed from the tiles then will we not need to add it to the controls?

@siimots
Copy link
Author

siimots commented May 23, 2022

iOS 15.5 was just released and it did not fix this problem.

File a new WebKit bug? Or ask in the existing one?

Maybe css will-change fix is needed in Leaflet CSS?

Simultaneously people are asking to remove will-change.

Leaflet has fixes for IE8-10, but why not make fixes for millions of iOS devices?
Safari is new IE. This bug has been there for 9 months and it does not look there will be any proper fix in sight.
Safari does not auto update from App Store. iOS update is needed, but many users skip those big updates.
It means Leaflet will be broken for long time for many users.

@Malvoz
Copy link
Member

Malvoz commented Jul 21, 2022

iOS 15.5 was just released and it did not fix this problem.

@siimots Is it fixed in 15.6? Otherwise you may want to re-open your original bug that was marked as duplicate of bug 238589.

It means Leaflet will be broken for long time

AFAICT (and as described in the bug report) the bug is only appearing during pan, so it's not totally broken, more of a UX bug. Anyway, even if the workaround was added to leaflet.css it wouldn't be fixed until the next release.

If you still think it is needed, feel free to send a PR and we can re-evaluate. I think we should use the @supports CSS at-rule to target Safari only, e.g.:

/* Safari bug fix for #8068. */
@supports (-webkit-touch-callout: none) {
  .leaflet-control-container .leaflet-top,
  .leaflet-control-container .leaflet-bottom {
    will-change: transform;
  }
}

@siimots
Copy link
Author

siimots commented Jul 21, 2022

I'm using iOS 16 beta and this bug is fixed there.

I do not have access to 15.x device at the moment.

@Malvoz Malvoz unpinned this issue Jul 21, 2022
@jonkoops
Copy link
Collaborator

Thanks for verifying that @siimots, much appreciated.

@cgalvarino
Copy link

cgalvarino commented Aug 4, 2022

FYI I see this issue in Chrome v 104.x on iPhone running iOS 15.5. #8068 (comment) does the trick. H/T!

@cgalvarino
Copy link

FYI I see this issue in Chrome v 104.x on iPhone running iOS 15.5. #8068 (comment) does the trick. H/T!

I spoke too soon. Didn't seem to fix it completely. I'll stay tuned for the iOS update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug compatibility Cross-browser/device/environment compatibility ios mobile won't fix
Projects
None yet
Development

No branches or pull requests

10 participants