Closed irenajur closed 2 years ago
Hi @irenajur 👋 Thanks for the issue.
I am not sure I would really consider this a bug worth fixing, as it would require adding resize observers which add extra complexity and could degrade performance (there was an effort in the past but it was abandoned for similar reasons).
It is not often that you open the dropdown and then resize the viewport. If you resize first and then open the dropdown, it behaves correctly.
@veekeys What do you think?
I checked other libs when I implemented Select
and no one was resizing dropdown menu when window was resized so I decided it is not worth the effort and as Mayank mentioned resize is handled correctly when dropdown menu is closed.
Wouldnt be enough to use already existing resize observer for this? If it is really too much work, I guess I agree it is not worth the effort. I forgot we recalculate minWidth on opening, so thought having hardcoded value is not really good... I will remove this from our backlog for now, but maybe lets keep it in here for others to see we are aware...
I am closing this.
Describe the bug (actual behavior)
Noticed this bug while inspecting the https://itwin.github.io/iTwinUI-react/?path=/story/input-select--many-items select styles. If you open the dropdown and then change the screen width - dropdown menu width will stay the same and might overflow out of the available screen width.
Expected behavior
Dropdown should not overflow the available screen width.
Reproduction
Link to a minimal repro: https://codesandbox.io/s/itwinui-react-select-issue-5yj3r
Steps to reproduce