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
Using popup in Blazor app breaks autoPan #8217
Comments
Hi, and thanks for taking the time to open a bug report in Leaflet. However, in this repository we only handle bugs in "vanilla" Leaflet. This means that we do not handle bugs which are specific to frameworks such as:
Please understand that we only have the time and energy to test Leaflet in plain web browsers. Please try to either reproduce the bug without using any frameworks, or submit a bug to the appropriate repo. |
And what would be the appropriate repo? Blazor is working fine, so Microsoft won't do anything. |
Then dissect whatever CSS properties and event handlers are being added to the Leaflet popup, replicate the problem without blazor but with using vanilla JS with those CSS properties and events, and open a new bug here. Emphasis on the "dissect". What's the minimal amount of vanilla HTML+JS that you must add to a Leaflet popup in order to reproduce the problem? |
That's impossible: I cannot disassemble a complete framework which does the heavy-lifting of rendering C# code in the browser. I opened an issue in the Blazor repo, but I'm pretty certain how the answer will look like. |
@IvanSanchez please see Microsoft's answer dotnet/aspnetcore#41577 (comment):
Does Leaflet offer a way to trigger a redraw or autopan after the fact? |
Yup. The Leaflet/src/layer/DivOverlay.js Line 170 in 9bfd4b9
...will call the logic to auto-pan the map so the popup is in view, which itself happens in an internal method at... Line 249 in 9bfd4b9
Don't forget to check https://leafletjs.com/reference |
I solved it, see here |
Steps to reproduce
Expected behavior
When opening the marker's popup, the map should automatically pan so that the popup`s complete content is visible. For example, it should look like this:
Current behavior
There is no panning of the map at all and therefore the popup opens outside the visible area:
Environment
Additional context
Maybe it's something similar to tombatossals/angular-leaflet-directive#741
Minimal example reproducing the issue
Since jsfiddle does not allow to use Blazor, there is no super-easy example. But you can simply clone and run my app: https://github.com/mu88/Project28/
Please create an example using https://leafletjs.com/edit.html or any other jsfiddle-like site.
The text was updated successfully, but these errors were encountered: