Skip to content

Performance issue on window resize event #15

@oroszlanyzsolt

Description

@oroszlanyzsolt

I would suggest to debounce the resize event and maybe orientationchange too. The other option could be instead of modifying className which may cause constantly reflow (as far I know), could be replaced with classList https://developer.mozilla.org/en-US/docs/Web/API/Element/classList

window.addEventListener('resize', updateScreen);
window.addEventListener('orientationchange', updateScreen);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions