fix(svg): svg mouse event doesn't work normally in Firefox when using shadow.#812
Merged
fix(svg): svg mouse event doesn't work normally in Firefox when using shadow.#812
Conversation
…ox >= 39. - To resolve the case where the chart uses SVG renderer and has shadow filter.
pissang
reviewed
Sep 10, 2021
| else if (env.browser.firefox | ||
| // use offsetX/offsetY for Firefox >= 39 | ||
| // PENDING: consider Firefox for Android and Firefox OS? >= 43 | ||
| && env.browser.version < '39' |
Contributor
There was a problem hiding this comment.
I suppose '39' should be a number here?
Collaborator
Author
There was a problem hiding this comment.
I'm not sure if the version string in some earlier versions will probably be like 88.0.1, though I saw the version string in the navigator.userAgent is like 88.0 in most of the versions. (Tested it in Firefox 50, 70, 80, 92)
| UA | FULL VERSION |
|---|---|
![]() |
![]() |
![]() |
![]() |
UPDATE
After reading these two threads, I guess it may be by design. So it should be okay if we change to use number 39.
Contributor
There was a problem hiding this comment.
Thanks for the explanation. Seems string comparison is better. Let's keep it.
Contributor
|
I'm really impressed by how you research the specs and fix these corner cases. Again thanks a lot! |
pissang
approved these changes
Sep 10, 2021
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Fix apache/echarts#15646
Fix apache/echarts#15697
It seems the
layerX/layerYis unexpected in the case where the chart uses SVG renderer and has shadow filter.From the above picture, we can see that the values of
layerX/layerY(unexpected) are not the same asoffsetX/offsetY(expected) and don't look like the offset relative to the "closest positioned element". (I couldn't know the reason)According to CANIUSE and the release note of Firefox, the
offsetXandoffsetYhave been supported since desktop Firefox 39And they have been also supported by Firefox for Android and Firefox OS since v43
As mentioned above, I'd like to use
offsetX/offsetYfor modern Firefox.A reproducible demo:
In addition, if we change to use
offsetX/offsetY, it will make the feature mentiond in #794 possible.