Skip to content

Conversation

@OstafinL
Copy link
Contributor

@OstafinL OstafinL 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

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

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
@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