From d32075741a42a7647506ce01beb07feb5ee78efe Mon Sep 17 00:00:00 2001 From: nina-mir Date: Wed, 26 Aug 2026 18:10:41 -0700 Subject: [PATCH] Upgrade Leaflet 1.9.3 to 1.9.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.9.3's _addFocusListenersOnLayer calls layer.getElement() unguarded, so any GeoJSON layer containing a nested FeatureGroup throws "t.getElement is not a function". 1.9.4 guards the call. This also restores verify_js_logs() in the MultiPoint tooltip test, which had to omit it for that reason. Because the driver fixture is session-scoped, the unread error stayed in the browser log and surfaced in whichever later test read it first — which is why test_notebook[coordinate_ordering.md] has been failing on main despite having no tooltips of its own. --- folium/folium.py | 4 ++-- tests/selenium/test_multipoints_tooltip_selenium.py | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/folium/folium.py b/folium/folium.py index edec9d972a..23c7fd2ab5 100644 --- a/folium/folium.py +++ b/folium/folium.py @@ -25,7 +25,7 @@ ) _default_js = [ - ("leaflet", "https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.js"), + ("leaflet", "https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.js"), ("jquery", "https://code.jquery.com/jquery-3.7.1.min.js"), ( "bootstrap", @@ -38,7 +38,7 @@ ] _default_css = [ - ("leaflet_css", "https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.css"), + ("leaflet_css", "https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.css"), ( "bootstrap_css", "https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css", diff --git a/tests/selenium/test_multipoints_tooltip_selenium.py b/tests/selenium/test_multipoints_tooltip_selenium.py index 76d3ad4566..3a31dab8a0 100644 --- a/tests/selenium/test_multipoints_tooltip_selenium.py +++ b/tests/selenium/test_multipoints_tooltip_selenium.py @@ -59,7 +59,4 @@ def test_geojson_multipoint_tooltip(driver): tooltip = driver.wait_until(".leaflet-tooltip.foliumtooltip") assert "multipoint" in tooltip.text - # No verify_js_logs() here: Leaflet 1.9.3 (our pin) throws - # "t.getElement is not a function" from _addFocusListenersOnLayer for any - # GeoJSON layer containing a nested FeatureGroup, independent of this fix. - # Guarded upstream in 1.9.4. + driver.verify_js_logs()