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
[GLJS-1346] Add option to support browser focus (#538)
Introduce `useBrowserFocus` option, which preserves backward compatibility
and gives a user access to the suggestion list with a keyboard
with respect to the default browser focus behaviour.
Copy file name to clipboardExpand all lines: API.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,7 @@ A geocoder component using the [Mapbox Geocoding API][74]
128
128
*`options.routing`**[Boolean][80]** Specify whether to request additional metadata about the recommended navigation destination corresponding to the feature or not. Only applicable for address features. (optional, default `false`)
129
129
*`options.worldview`**[String][76]** Filter results to geographic features whose characteristics are defined differently by audiences belonging to various regional, cultural, or political groups. (optional, default `"us"`)
130
130
*`options.enableGeolocation`**[Boolean][80]** If `true` enable user geolocation feature. (optional, default `false`)
131
+
*`options.useBrowserFocus`**[Boolean][80]** If `true`, the geocoder will use the browser's focus event to show suggestions. If `false`, it will only highlight active suggestions and Tab will not propagate to the suggestions list. (optional, default `false`)
131
132
*`options.addressAccuracy`**(`"address"` | `"street"` | `"place"` | `"country"`)** The accuracy for the geolocation feature with which we define the address line to fill. The browser API returns the user's position with accuracy, and sometimes we can get the neighbor's address. To prevent receiving an incorrect address, you can reduce the accuracy of the definition. (optional, default `"street"`)
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
## HEAD
2
2
3
+
- Introduce `useBrowserFocus` option to use the browser's native focus management instead of the geocoder's custom focus management. This is useful for accessibility.
Copy file name to clipboardExpand all lines: lib/index.js
+131-1Lines changed: 131 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,7 @@ function getFooterNode() {
75
75
* @param {Boolean} [options.routing=false] Specify whether to request additional metadata about the recommended navigation destination corresponding to the feature or not. Only applicable for address features.
76
76
* @param {String} [options.worldview="us"] Filter results to geographic features whose characteristics are defined differently by audiences belonging to various regional, cultural, or political groups.
77
77
* @param {Boolean} [options.enableGeolocation=false] If `true` enable user geolocation feature.
78
+
* @param {Boolean} [options.useBrowserFocus=false] If `true`, the geocoder will use the browser's focus event to show suggestions. If `false`, it will only highlight active suggestions and Tab will not propagate to the suggestions list.
78
79
* @param {('address'|'street'|'place'|'country')} [options.addressAccuracy="street"] The accuracy for the geolocation feature with which we define the address line to fill. The browser API returns the user's position with accuracy, and sometimes we can get the neighbor's address. To prevent receiving an incorrect address, you can reduce the accuracy of the definition.
79
80
* @example
80
81
* var geocoder = new MapboxGeocoder({ accessToken: mapboxgl.accessToken });
0 commit comments