Skip to content
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

Bug - [Truncate] - remove resize observer #10974

Open
christianvogt opened this issue Sep 11, 2024 · 0 comments
Open

Bug - [Truncate] - remove resize observer #10974

christianvogt opened this issue Sep 11, 2024 · 0 comments

Comments

@christianvogt
Copy link
Contributor

Describe the problem

I don’t believe there’s need for the Truncate component to be calculating whether or not to include the tooltip upfront or even on resize. The tooltip is only shown either on mouse over or on focus. Therefore it should be possible to remove the resize observer.

Furthermore, this component unmounts the children whenever the truncation state changes instead of simply marking the tooltip as hidden.

It would seem to me that a lot of performance could be gained here if a page contains many Truncate components susceptible to resizing.

How do you reproduce the problem?
Visit https://www.patternfly.org/components/truncate#default
Using inspector dev tools, to track react component re-renders.
Drag the bounding box of the truncated text such that all the text is shown and then back to truncated.

Observe the component remounts every time the threshold is met.

Expected behavior
Unless the content changes, the component shouldn't remount.

Is this issue blocking you?
No

What is your environment?

  • OS: mac
  • Browser chrome
  • Version 127

What is your product and what release date are you targeting?
RHOAI

Any other information?

@tlabaj tlabaj added this to the Prioritized Backlog milestone Sep 19, 2024
@kmcfaul kmcfaul removed the bug label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

3 participants