Skip to content

calculateWidthDependentElements function is called too often #1656

@shadowbas

Description

@shadowbas

Describe the bug
calculateWidthDependantElements causes a considerable slowdown. This is mostly due to the fact that it is called in ngDoCheck.

This computation is used to determine if buttons should be visible or collapsed into a collapsable dropdown.
The components that depend on this computation can be found in the following screenshots.

Screenshots
Image

Solution
Instead of performing this calculation on ngDoCheck (which is run on every Angular re-render) it should be done whenever a resize of relevent elements occur. The relevant element being the container element in which the buttons are situated.

See https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions