Skip to content

Theme: the system color scheme listener is never detached #95

Description

@StanZGenchev

window.matchMedia() returns a new object on every call, so the code meant to remove the auto-mode handler removes it from a freshly created object rather than from the one that holds it. An explicit light or dark choice is therefore overridden the next time the system scheme flips, even though the saved mode still says otherwise, and selecting auto repeatedly stacks handlers, so a single flip notifies every listener once per selection.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions