-
Notifications
You must be signed in to change notification settings - Fork 370
fix(Truncate): remove resize observer #12055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(Truncate): remove resize observer #12055
Conversation
- @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - @patternfly/[email protected] - [email protected] - @patternfly/[email protected] - @patternfly/[email protected]
Preview: https://pf-react-pr-12055.surge.sh A11y report: https://pf-react-pr-12055-a11y.surge.sh |
0104b5a
to
ec5e337
Compare
I'd want to make sure that #11811 still works - noting this down so I don't forget when I come back to review this. |
Signed-off-by: gitdallas <[email protected]>
ec5e337
to
c047af3
Compare
Signed-off-by: gitdallas <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One issue with this update is that the truncate always has a tabindex of 0 now, when it should really only have that when truncation is actually in effect. Otherwise potentially a lot of static text that isn't truncated will just add an equal amount of unneccessary tab stops to the page.
@thatblindgeye - looks like i can set isTruncated to |
I think both are important, though I don't know which (if either) is more important. That's probably a lengthier discussion. @christianvogt for your use case, are you taking advantage of the resizability of the Truncate component, i.e. whether the content is actually truncated or not can change depending on the viewport width or the content can be of varying length? Or is it pretty reliable that wherever Truncate is being used things will always be Truncated or always not be Truncated (like in a Table column that is always fairly narrow)? Mainly asking because if it's the latter - and assuming using the maxCharsDisplayed prop isn't viable - I wonder if adding a prop to dictate whether the resize observer is even used would be useful (or debouncing the resize observer). |
I believe when I created the original issue it was because the component was unmounting and remounting needlessly. Secondary after looking into the code I made the comment about performance and the potential to omit the resize handler. However I didn't consider the tab index case. For our use case I would still like the text react to container size. |
What: Closes #10974