Skip to content

[resize-observer] Add option to skip firing on observe #12608

@gitspeaks

Description

@gitspeaks

observe() always triggers the callback once with the current size. This makes it impossible to pause and resume without extra logic to ignore that first call.

For example, if we want to explicitly change an element’s size and not have the callback fire, we cannot simply unobserve() and then observe() again - the re-observation will still trigger the callback.

Proposal: Add a boolean option to ResizeObserverOptions to suppress the initial callback when starting observation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions