Fixes #2002, mainly by removing the autoUpdate function which was being executed even when the tooltip is closed. I also removed floatingStyles when the tooltip is closed, and memoized the middleware object to avoid recreating it on each re-render.
Testing
Manually tested that the performance issue is fixed, with 6x CPU slowdown in Chrome devtools.
Before
https://github.com/iTwin/iTwinUI/assets/9084735/34c602bd-4197-467a-939f-d8a62b918b83
After
https://github.com/iTwin/iTwinUI/assets/9084735/77b9f38e-b179-4094-830e-57486e30c3b1
Changes
Fixes #2002, mainly by removing the
autoUpdate
function which was being executed even when the tooltip is closed. I also removedfloatingStyles
when the tooltip is closed, and memoized themiddleware
object to avoid recreating it on each re-render.Testing
Manually tested that the performance issue is fixed, with 6x CPU slowdown in Chrome devtools.
Before
https://github.com/iTwin/iTwinUI/assets/9084735/34c602bd-4197-467a-939f-d8a62b918b83After
https://github.com/iTwin/iTwinUI/assets/9084735/77b9f38e-b179-4094-830e-57486e30c3b1Docs
Added changeset.