You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When auto-collapsing is used, when the user clicks on a result, the box is left open. It should be auto-closed, as the user has made a definitive decision and the action is complete.
I have created a workaround, but this is unsatisfactory because it force-clears the input:
// Auto-close on select; see: https://maplibre.org/maplibre-gl-geocoder/classes/default.html#on
geocoder.on ('result', function () {
document.querySelector ('.maplibregl-ctrl-geocoder--button').click (); // Click to remove the search value
document.querySelector ('.maplibregl-ctrl-geocoder--input').blur (); // Move away from the search box
});
I tried using the _collapse method, which seems to be advertised as public despite the underscore, but this had no effect, as I see its internal implementation ignores the call if there is focus.
The text was updated successfully, but these errors were encountered:
In the Javascript, add collapsed: true to the example given, in the new MaplibreGeocoder options parameter
The map will load below, with the control collapsed by default
Hover over the control
Click in the geocoder input box
Type a location, e.g. Paris, and press return
[The map will go to the first location, and place a marker, which is a very odd behaviour but that's a separate problem]
Click on the drop-down that appears, to select a desired item
The map moves to that location
The box is left open, even though the user has made a selection. The user has to erase the contents, and then blur away, in order to get rid of it, which is not intuitive.
The last step should not be necessary - selection of an item from the drop down should auto-close the control.
When auto-collapsing is used, when the user clicks on a result, the box is left open. It should be auto-closed, as the user has made a definitive decision and the action is complete.
I have created a workaround, but this is unsatisfactory because it force-clears the input:
I tried using the _collapse method, which seems to be advertised as public despite the underscore, but this had no effect, as I see its internal implementation ignores the call if there is focus.
The text was updated successfully, but these errors were encountered: