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

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.
Describe the bug
calculateWidthDependantElementscauses a considerable slowdown. This is mostly due to the fact that it is called inngDoCheck.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

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.
Additional context
Add any other context about the problem here.