Skip to content

Revalidation on focus broken in Chrome #4130

Open
@steviesocks

Description

@steviesocks

Bug report

Description / Observed Behavior

Query revalidation on focusing the page/tab doesn't work in Chrome. This still works as expected in Safari. It appears to be related to document.visibilityState not updating to hidden when the user changes tab or window.

Expected Behavior

Query should revalidate on focus in Chrome. Confirmed this works as expected in Safari.

Repro Steps / Code Example

https://github.com/steviesocks/swr-bug

Additional Context

SWR version 2.2.5
Chrome Version 137.0.7151.56 (Official Build) (arm64)
Next version 14.2.26

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions