-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
My use case is this:
I want to request the wake lock when I open a modal, so request is made in conjunction with a button press. When visibility changes, the wake lock is correctly released and then requested again when returning to the tab.
However, even when the modal is not open, the wake lock request is made simply because visibility changes on the document and the hook is rendered because there is no conditional checking whether it should reacquire the wake lock or not, simply that it does because the visibility has changed.
A fix for this would be to supply an a conditional option for when to reacquire on visibility change.
As a working example, check out the official demo over at MDN.
Metadata
Metadata
Assignees
Labels
No labels