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

IBX-6123: Fixed tooltips ellipsis #848

Merged
merged 1 commit into from
Jul 25, 2023
Merged

Conversation

lucasOsti
Copy link
Contributor

@lucasOsti lucasOsti commented Jul 25, 2023

Question Answer
Tickets https://issues.ibexa.co/browse/IBX-6123
Bug fix? yes
New feature? no
BC breaks? no
Tests pass? yes
Doc needed? no
License GPL-2.0

Checking whether the text goes beyond the container by the condition tooltipNode.scrollWidth > tooltipNode.offsetWidth is not very precise because scrollWidth and offsetWidth return a value as a natural number and in some cases the difference was less than 1.
To check if the text goes beyond the container, I create a temporary html node and set the values ​​for

  1. content: title from tooltipNode
  2. style: font, padding abd width from tooltipNode

Finally I check if the temporary node has a higher height value than the source node, if so, it means that it is outside the container.

Checklist:

  • Coding standards ($ composer fix-cs)
  • Ready for Code Review

@lucasOsti lucasOsti changed the base branch from main to 4.5 July 25, 2023 09:46
@bogusez bogusez self-assigned this Jul 25, 2023
@lucasOsti lucasOsti force-pushed the IBX-6123-fixed-title-ellipsis branch from c7d47be to 6860497 Compare July 25, 2023 11:42
@sonarcloud
Copy link

sonarcloud bot commented Jul 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ciastektk ciastektk merged commit e89bd91 into 4.5 Jul 25, 2023
14 checks passed
@ciastektk ciastektk deleted the IBX-6123-fixed-title-ellipsis branch July 25, 2023 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants