Skip to content

Media Check goes into every media query on page load #27

@csamoiloff

Description

@csamoiloff

When you first load a page, mediaCheck goes into every media query, even if it’s not relevant, which then triggers an exit event. (e.g. media: '(min-width: 64.063em)' is entered even if the browser width is less than 64.063em). I had to get around it by setting a flag and using it in all of the exit functions (if (vInitialCheck) return;) except for the last one, where I reset the flag (if (vInitialCheck) {vInitialCheck = false; return;} Is there a way to add this to the main code? I don't think functions should ever get run unless you actually are in a valid media query for the browser size.

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