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.

Leflet map in iframe: page scrolls down to bottom on first click on map

See original GitHub issue

Hi I have noticed an annoying problem when I embed a leaflet into a iframe. On my mobile iphone 5 the page scrolls down to the bottom on the first click on the map.

The thing is easily reproducible but only appears in mobile phones, web works fine.

surf to this page with your phone and test http://ext.dn.se/qs/widgets/test/iframeTest2.html

Or make a testpage like

<iframe id="test"  style=" height:400px; width:100%;" scrolling="no"  frameborder="0" src="http://leafletjs.com/examples/mobile/example.html"></iframe>

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kazhecommented, May 9, 2018

With the latest version of leaflet if you set keyboard:false in the options of Leaflet, the bug is gone, as previously the focus() was called because of the initialized hook, but now it isn’t anymore, so while the bug still kinda exists, it is not that painful

1reaction
gerdintcommented, Feb 15, 2018

A version of Leaflet 1.0.3 incorporating this patch has been deployed at https://www.havochvatten.se/hav/samordning--fakta/havsplanering/havsplaner/forslag-till-havsplaner/vagledning-om-mest-lamplig-anvandning.html.

It works well for us so would recommend merging the proposed patch. I’ll put up a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Leaflet Map is Zooming out too far - Stack Overflow
When I scroll out, I can't get the map region to be locked to one Earth. That is, when I scroll out all...
Read more >
Leaflet in map iFrame scroll issue - Google Groups
The problem is that when a user scrolls down on a touch device the page scrolls but as soon as the scrolling reaches...
Read more >
Leaflet map scrolled when dragging the page on mobile [closed]
I have a Leaflet map embedded in a div with vertical scroll. ... I scroll the page (touching outside the map) the map...
Read more >
Creating, hosting, and publishing Leaflet maps with qgis2web ...
This workshop will not cover how to create the geospatial data or host images in web maps. However, some bonus sections at the...
Read more >
Making an Interactive Web Application with R and Shiny
An interactive map with an adjustable timeline is, in some cases, ... using iframes: see the Mapping the Gay Guides project for one...
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