Skip to content

Fix Search opening group-bound GeoJson popups - #2341

Open
adarshsm wants to merge 2 commits into
python-visualization:mainfrom
adarshsm:fix/1286-search-geojson-popup
Open

adarshsm wants to merge 2 commits into
python-visualization:mainfrom
adarshsm:fix/1286-search-geojson-popup

Conversation

@adarshsm

Copy link
Copy Markdown
Contributor

Fixes #1286.

GeoJsonPopup binds its popup to the GeoJSON group. The Search callback only checks the matched feature's _popup, so it never opens a group-bound popup.

When the feature has no popup of its own, temporarily bind the group's popup to that feature, open it, and remove the temporary binding. This gives the popup content callback the matched feature without leaving duplicate click handlers behind. Existing feature-bound popups keep their current path.

Added a generated-JavaScript regression test, confirmed failing before the fix and passing afterward.

Verification

  • pytest tests/plugins/test_search.py -q: 1 passed.
  • Local runtime check with real Leaflet 1.9.3, Leaflet Search 2.9.7, and jsdom: the unmodified callback leaves the popup closed; the fixed callback opens it with the second feature's content. Normal feature clicks still work and no extra feature popup binding remains. This was a local check, not a Selenium/browser-suite run.
  • pytest tests --ignore=tests/snapshots --ignore=tests/selenium --ignore=tests/playwright -q: 396 passed, 4 failed. The same four tests fail on unmodified upstream: missing geodatasets and three PNG-rendering tests requiring Selenium. No new suite failures.
  • Scoped ruff check and git diff --check: passed.

🤖 Generated with Claude Code

Open the group popup with the matched feature as its source, without leaving a duplicate feature binding.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@hansthen
hansthen marked this pull request as ready for review November 15, 2026 12:36
@hansthen

Copy link
Copy Markdown
Collaborator

@adarshsm Looks okay. I just have one failing black test. Can you run the black formatter over this?

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
pypi — a8b28ec2 Deployed Nov 16, 2026 by adarshsm via packages #2094
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to open the popup automatically when a search is found for a GeoJson layer?

2 participants