Skip to content

Use Geolocation operation if granted #78

Description

@davidkelley

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions