Skip to content

IBX-12287: Fixed tooltips disappearing on elements without line-clamp - #2013

Open
tischsoic wants to merge 1 commit into
4.6from
IBX-12287-tooltips-line-clamp
Open

IBX-12287: Fixed tooltips disappearing on elements without line-clamp#2013
tischsoic wants to merge 1 commit into
4.6from
IBX-12287-tooltips-line-clamp

Conversation

@tischsoic

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12287

Related PRs:

Description:

IBX-11804 extended the ellipsis detection in tooltips.helper.js with:

const hasEllipsisStyle = computedStyle.textOverflow === 'ellipsis' || computedStyle['-webkit-line-clamp'];

The computed value of -webkit-line-clamp on elements that don't use it is the string 'none', which is truthy — so since that change every [title] element is treated as ellipsized text. parse() then only creates a tooltip when isTitleEllipsized() decides the title text would be taller than the element; for everything else it removes the title attribute and creates no tooltip, permanently (re-parses skip nodes that already carry data-original-title).

Effect product-wide: tooltips silently disappeared from most non-truncated elements. Most visible on DS icon-only buttons (padding: 0, wide content box) — e.g. short titles like "Search" or "Fields" get no tooltip while longer ones ("Add to bookmarks") pass by accident. Legacy buttons often still worked only because their narrow content boxes made the measured text taller than the element.

The fix makes the clamp check honest while preserving IBX-11804's intent:

const { textOverflow, webkitLineClamp } = getComputedStyle(tooltipNode);
const hasLineClamp = !!webkitLineClamp && webkitLineClamp !== 'none';
const hasEllipsisStyle = textOverflow === 'ellipsis' || hasLineClamp;

Non-clamped, non-ellipsis elements get tooltips unconditionally again; text-overflow: ellipsis and genuine line-clamp: N elements keep the "only when truncated" behavior added by IBX-11804.

Verified on a 6.0 instance (fix applies identically — the file matches across 4.6/5.0/6.0):

  • Page Builder action-bar buttons (DS, icon-only): tooltips show again (Fields / Visibility / preview switcher / undo-redo "Nothing to undo").
  • Single-line ellipsis element with non-truncated text: still NO tooltip (correct).
  • Synthetic -webkit-line-clamp: 2 probes: short text → title stripped, no tooltip; truncated text → tooltip shows (IBX-11804 behavior intact).

For QA:

  1. Back office anywhere: icon-only DS buttons (global search magnifier, bookmarks star, Page Builder action bar on 5.0/6.0) show their tooltips on hover.
  2. Content list table with a long name clamped to 2 lines: tooltip appears only when the name is actually truncated (IBX-11804 scenario unchanged).
  3. A short, fully visible clamped/ellipsized text shows no tooltip.

Documentation:

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

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.

5 participants