iTwin / iTwinUI-react

A react component library for iTwinUI.
https://github.com/iTwin/iTwinUI
Other
84 stars 23 forks source link

fix: Focus is lost while resizing on overflow #777

Closed veekeys closed 2 years ago

veekeys commented 2 years ago

Closes #768

Previously focus was being lost whenever we were resizing the window (rerender happened) and that is mostly caused if the DOM structure is changing (then even having a key on element does not help). Moved elements around, to fix this issue.

Breadcrumbs: Moved inner components outside, because they were getting a new ref and as a result on every rerender new DOM was being created, which led to focus being lost.

ButtonGroup: Moved conditions a little, so DOM is kept the same

MiddleTextTruncation: Found that substr is marked as deprecated