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

fix(truncate) tooltip shows without truncation #10281

Merged
merged 4 commits into from
May 10, 2024

Conversation

Dominik-Petrik
Copy link
Contributor

@Dominik-Petrik Dominik-Petrik commented Apr 16, 2024

What: Closes #10053

Additional issues: I have also added hidden prop to the Tooltip component which is useful both for this issue and in general

@patternfly-build
Copy link
Contributor

patternfly-build commented Apr 16, 2024

Comment on lines 139 to 140
/** Determines whether the tooltip is hidden regardless of visibility **/
hidden?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether we should introduce this prop, mainly because we already have an "isVisible" prop for manual control of a Tooltip.

Rather than needing to create this prop, we could just conditionally return either the "full" Truncate content (if there is no truncation; basically everything that is currently being passed to Tooltip) or the "full" Truncate content wrapped in the Tooltip (if there is truncation).

We do something similar in ModalBoxTitle.

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 😎 One nit, though, is that rather than using the ResizeObserver constructor, we could try to use our getResizeObserver helper instead. The WizardBody component and the JumpsLinksWithDrawer demo are two examples that are using it in functional components.

@tlabaj tlabaj merged commit f730154 into patternfly:main May 10, 2024
13 checks passed
@patternfly-build
Copy link
Contributor

Your changes have been released in:

  • eslint-plugin-patternfly-react@5.4.0-prerelease.1
  • @patternfly/react-charts@7.4.0-prerelease.4
  • @patternfly/react-code-editor@5.4.0-prerelease.9
  • @patternfly/react-core@5.4.0-prerelease.9
  • @patternfly/react-docs@6.4.0-prerelease.12
  • @patternfly/react-drag-drop@5.4.0-prerelease.10
  • @patternfly/react-icons@5.4.0-prerelease.3
  • demo-app-ts@5.1.1-prerelease.110
  • @patternfly/react-styles@5.4.0-prerelease.3
  • @patternfly/react-table@5.4.0-prerelease.9
  • @patternfly/react-templates@1.1.0-prerelease.9
  • @patternfly/react-tokens@5.4.0-prerelease.3

Thanks for your contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug - Truncate - tooltip also shows when there is no actual truncation
4 participants