There is a very large performance overhead in using multiple instances of components that use the floating directive due to position calculations running while the floating ref is hidden.
Describe how to reproduce the bug
Place some kirby-menu's or other components using the floating directive on a page and start scrolling.
The performance hit will be visible in the browser performance profiler
Which Kirby version was used?
9.0.0
## What was the expected behavior?
A much lower performance impact from updating positions of hidden floating elements.
Add any screenshots
Below image is a profiling of a table with a kirby-menu in each row.
The areas with red bars are when the table is scrolled.
Below is the same table and same interaction pattern, but with the kirby-menu components removed.
Please complete the following information:
OS: Windows
Browser: Edge
Browser version: 120.0.2210.144
Are there any additional context?
The following diff should fix most of the issues as far as i can tell.
You may wish to investigate further though.
Describe the bug
There is a very large performance overhead in using multiple instances of components that use the floating directive due to position calculations running while the floating ref is hidden.
Describe how to reproduce the bug
Place some kirby-menu's or other components using the floating directive on a page and start scrolling. The performance hit will be visible in the browser performance profiler
Which Kirby version was used?
9.0.0 ## What was the expected behavior?A much lower performance impact from updating positions of hidden floating elements.
Add any screenshots
Below image is a profiling of a table with a kirby-menu in each row. The areas with red bars are when the table is scrolled.![with-kirby-menu](https://github.com/kirbydesign/designsystem/assets/5255948/a05dc9c3-69e4-4345-afce-1a89f26161c0)
Below is the same table and same interaction pattern, but with the kirby-menu components removed.![without-kirby-menu](https://github.com/kirbydesign/designsystem/assets/5255948/f928df3c-f26d-43ca-a028-13558f1136ab)
Please complete the following information:
Are there any additional context?
The following diff should fix most of the issues as far as i can tell. You may wish to investigate further though.
Checklist:
The following tasks should be carried out in sequence in order to follow the process of contributing correctly.
Verification
To make sure the bug is not intended behaviour; it should be verified by a member of team Kirby before moving on to implementation.
NOT verified
label has been removed by a member of team Kirby; do not proceed until this is doneImplementation
The contributor who wants to implement this issue should:
Review
Once the issue has been implemented and is ready for review: