question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hover on L.SVG paths after map pan is broken on firefox

See original GitHub issue

The element of path will lose interactive sometimes when move the map in firefox

How to reproduce:

  • Create map with one or more vector layers rendered in a L.SVG
  • Pan the map (so that the pixel bboxes of the vector layers don’t overlap with their previous positions)
  • Hover over the vector layers

The pointer cursor will not update, and the hover events will not fire.

Only seems to be reproducible in Firefox >= v55.0.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
nrennercommented, Jan 19, 2018

I can reproduce by panning the map once (in any direction), so that features don’t overlap with their old positions. Firefox 57.0.4 (64-Bit) and Firefox Nightly 59.0a1 (2018-01-19) (64-Bit) on Ubuntu 16.04.

Interactive Leaflet demo

From using the Firefox Inspector to see what changes when panning the map, I created the following demos that reproduce the issue without Leaflet:

Interactive demo without Leaflet

Automated test

The observed change when panning the map is moving (transitioning) the leaflet-map-pane and the svg elements. Simplified example as in the demo:

    pane.style.transform = 'translate3d(200px, 0px, 0px)';
    svg.style.transform = 'translate3d(-200px, 0px, 0px)';
    svg.setAttribute('viewBox', '-200 0 400 200');

The corresponding Leaflet code parts are:

https://github.com/Leaflet/Leaflet/blob/ae8a1a645a3ed2c2637b6ae9056f0c1ff794949c/src/map/Map.js#L1219-L1221

https://github.com/Leaflet/Leaflet/blob/ae8a1a645a3ed2c2637b6ae9056f0c1ff794949c/src/layer/vector/SVG.js#L97-L99

4reactions
IvanSanchezcommented, Apr 25, 2018

I don’t know what is the problem. I don’t know how I can reproduce the problem on my computer. I do not know if the problem happens on all web browsers.

I do not know if the problem happens when panning the map with the mouse, or with a touchscreen, or with the keyboard, or with all. I don’t know if the problem happens when doing one thing at once, or several things at once.

We do not have enough information to know what the problem is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firefox hover effect on SVG image element not working
I've attempted to play around with other suggestions like pointer-events, changing the to a path, and numerous others to no avail. I'm not...
Read more >
SVG path element not working in FF 6.06 but ... - Mozilla Support
Hi, I am writing a game using SVG and for some reason the path element is not dispaying in FF 6.06. It follows...
Read more >
Safari Technology Preview Release Notes - Apple Developer
Fixed an issue where browser.tabs sometimes returned an incorrect URL for pinned tabs. Bug Fixes. Fixed the Share Menu when sharing an image...
Read more >
touch-action - CSS-Tricks
The touch-action property in CSS gives you control over the effect of touchscreen interactions with an element, similar to the more ...
Read more >
Using SVG with CSS3 and HTML5
CSS Versus SVG: Paths Beyond SVG ... state of graphics on the web had changed considerably since when ... and recent Firefox and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found