Open jasdom opened 1 week ago
@jasdom Thanks for reporting this issue with a useful repro.
I looked into this for a while. Although I'm not totally sure of what's causing the issue, I think there is an infinite loop where the visibleCount
from our useOverflow
internal hook changes on each resize of iui-select-tag-container
and each resize changes the visibleCount
.
I believe if useOverflow
is able to give an accurate visibleCount
value that does not trigger a large resize, this issue will be fixed.
Investigating this further.
cc @iTwin/itwinui-1
Describe the bug (current behavior)
When
multiple
property is set to true and more options are selected than can fit inside theComboBox
input component, occasionally the selected options will start jittering by switching back and forth between displayingn
andn+1
options.The issue only happens under some sizes of the
ComboBox
and does not always replicate with the same settings on different machines or browsers. Seems like it occurs when the available space is almost enough to fit another tag in.Expected Behavior
Displayed selected option amount does not rapidly change.
Link to minimal repro
https://stackblitz.com/edit/github-sfphuz-laltrk?file=src%2FApp.tsx
Steps To Reproduce
ComboBox
components.Anything else?
No response