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
tooltipAnchor has limited or no effect for some Tooltip directions #6764
Comments
same here |
Is it fixable by #6116? |
No, it's even more broken than before. That's likely because that pull request uses For comparison, this is the current behavior of my minimal example back then when I created the issue. The most recent master branch version shows the same behavior. And this is the behavior of the latest commit 20784d7 from pull request #6116 with my minimal example code. |
Can you provide own PR to fix this issue? |
This commit fixes issue #6764, see the discussion examples there. It's an alternative implementation for pull request #6116. It makes `tooltipAnchor` behave the same like `popupAnchor` regardless of the tooltip's direction. With one exception: the `auto` direction flips the `x` axis of `tooltipAnchor` and the tooltip's `offset` when it switches to `left` depending on the position on the screen. `auto` therefore assumes that the icon is somewhat symmetrical to the left and the right of the y axis, which is the case for the default icon.
`webpack` v4 => v5: - `script-ext-html-webpack-plugin` is deprecated and unnecessary now, the feature I use is now in `html-webpack-plugin` - `preload-webpack-plugin` is deprecated, use fork `@vue/preload-webpack-plugin` instead - `optimize-css-assets-webpack-plugin` wont adjust to `webpack` v5, use `css-minimizer-webpack-plugin` instead `leaflet` 1.6.0 => 1.7.1: - contains my fix for Leaflet/Leaflet#6764 now, so I can remove my workaround. `sass`: - `node-sass` is deprecated, use `sass` (`dart-sass`) instead. - `sass-loader`: the `~` import no longer works. Therefore prefix spritesmith filenames with `img-`, to fix the ambiguity between `src/css/icons.scss` and `build/img/icons.scss` Can't upgrade `wtf_wikipedia` to 8.0.0 or higher right now, because of issues with: - https://github.com/substack/https-browserify/issues/9 - jhiesey/stream-http#116
Yes, you're correct. I wrongly assumed my commit 5b30f7d would auto close this issue when being merged (I wrote too much in the first sentence of the commit message). |
Steps to reproduce
Steps to reproduce the behavior:
tooltipAnchor
option with a non-zero value for x.top
,bottom
orcenter
direction.Expected behavior
The anchor of the Tooltip should move relative to the
iconAnchor
according to the values defined in thetooltipAnchor
. It should have the same behavior aspopupAnchor
according to the documentation, e.g. if given the same values it should position itself at the same position as the Popup.Current behavior
tooltipAnchor.x
has no effect for the directionstop
,bottom
andcenter
.tooltipAnchor.y
has no effect for thebottom
direction.Environment
Additional context
Source code responsible for the issue:
Leaflet/src/layer/Tooltip.js
Lines 144 to 156 in 1e0d43b
Minimal example reproducing the issue
https://jsfiddle.net/590jt8fx/
The text was updated successfully, but these errors were encountered: