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
In Firefox the state returned by useGeolocation is never updated when permission is requested and given. It will only update if permission is given permanently and the page is then reloaded (or the component using the hook is remounted).
Click "Allow" when location permission is requested.
Notice the text never changes from "Retrieving position..."
Expected behavior
The state should update and the location should be shown as soon as it's retrieved.
I've tested this using:
Firefox 112.0.2 (64-bit) on Mac M1 Ventura 13.3.1 (22E261)
Firefox 108.0.1 (64-bit) on Windows 10 Pro 21H2
This issue did not occur on my Pixel 7 with Firefox 112.2.0 (running Android UpsideDownCake beta UPB1.230309.017)
Additional context
Oddly, using useGeolocationState directly does work as expected (although the examples are currently broken). And the events returned are triggered (i.e. onChange).
The text was updated successfully, but these errors were encountered:
I'm also experiencing issues with useGeolocation. The component where it's being used correctly reports position data when the component mounts. Then if the component unmounts, returning to that component no position data is returned. It doesn't appear to be limited to Firefox, this is occurring in Chrome.
I love beautiful-react-hooks and generally use it in most of my projects but there is something just not working right with this particular hook.
Describe the bug
In Firefox the state returned by
useGeolocation
is never updated when permission is requested and given. It will only update if permission is given permanently and the page is then reloaded (or the component using the hook is remounted).To Reproduce
Steps to reproduce the behavior:
Expected behavior
The state should update and the location should be shown as soon as it's retrieved.
I've tested this using:
This issue did not occur on my Pixel 7 with Firefox 112.2.0 (running Android UpsideDownCake beta UPB1.230309.017)
Additional context
Oddly, using
useGeolocationState
directly does work as expected (although the examples are currently broken). And the events returned are triggered (i.e.onChange
).The text was updated successfully, but these errors were encountered: