On some websites, the customer may have already granted geolocation permissions. This work is intended to take advantage of this by introducing a useGeolocation={<boolean>} prop on the <PostcodeLookup.Input/> component. The goal is to automatically populate the postcode input field, with nearby postcodes, essentially enabling one-click postcode lookup.
Requirements
useGeolocation must be truthy (defaults to false) to avoid breaking changes.
navigator.permissions API must be available
navigator.geolocation API must be available
- geolocation lookup is performed once, when the component initially mounts.
On some websites, the customer may have already granted geolocation permissions. This work is intended to take advantage of this by introducing a
useGeolocation={<boolean>}prop on the<PostcodeLookup.Input/>component. The goal is to automatically populate the postcode input field, with nearby postcodes, essentially enabling one-click postcode lookup.Requirements
useGeolocationmust be truthy (defaults tofalse) to avoid breaking changes.navigator.permissionsAPI must be availablenavigator.geolocationAPI must be available