Currently, when the widget is added to the map, and the user hovers over the search button, the input field is uncollapsed, but the user has to give focus manually by clicking in the input field. This seems unnecessary, given that the user intention will almost always be to want to start typing.
It would therefore be useful to have a focus/autofocus option to add autofocus.
For now, the following workaround will do this:
// Add auto-focus to the widget
document.querySelector ('.maplibregl-ctrl-geocoder').addEventListener ('mouseenter', function () {
document.querySelector ('.maplibregl-ctrl-geocoder--input').focus ();
});
Currently, when the widget is added to the map, and the user hovers over the search button, the input field is uncollapsed, but the user has to give focus manually by clicking in the input field. This seems unnecessary, given that the user intention will almost always be to want to start typing.
It would therefore be useful to have a focus/autofocus option to add autofocus.
For now, the following workaround will do this: