[FIX] web_view_leaflet_map: reload markers on search domain change#462
Closed
Jonasaaaa wants to merge 1 commit into
Closed
[FIX] web_view_leaflet_map: reload markers on search domain change#462Jonasaaaa wants to merge 1 commit into
Jonasaaaa wants to merge 1 commit into
Conversation
The map renderer only loaded its records on willStart, so applying a search filter or favorite never refreshed the markers (onPatched re-rendered the same, stale records). Add onWillUpdateProps to reload the records with the new domain/context; loadRecords now accepts an optional domain/context so the filtered result is fetched before onPatched re-renders the markers.
Contributor
|
Hi @legalsylvain, |
Author
|
Closing: the fix belongs on the 19.0 line (built on the ongoing migration PR #459), not on 18.0. Superseded accordingly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the
leaflet_mapview, applying a search filter or favorite doesnot update the markers. The renderer loads its records only in
onWillStartand never reacts to later domain changes;
onPatchedre-renders the markersbut from the same, stale
this.records. As a result the map keeps showing allrecords regardless of the active search.
Fix
Add an
onWillUpdatePropshook that reloads the records with the newdomain/contextbefore the component is patched.loadRecordsnow acceptsan optional
domain/context(falling back tothis.props), so the filteredresult is fetched and
onPatchedthen re-renders the up-to-date markers.No change to the view API; filtering now works on every
leaflet_mapview.How to test
leaflet_mapview with a search view that hasfilters (e.g.
web_view_leaflet_map_partner).