six-tag: empty tooltip opens and gets stuck when hovered right after render

Open
#593 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
50/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
frontend

Research direction

Start in the six-tag component's updateTooltip() path, which disables the inner six-tooltip about 0.3 seconds after render, then read hide() in six-tooltip.js around line 132, where the early return on disabled blocks closing. Two fixes are proposed: create the inner tooltip disabled, or let hide() close a visible tooltip. Done means hovering during render no longer leaves an empty tooltip open, and the maintainers have chosen which fix to keep.

Written by the indexing model from the issue text.

Description

Six Webcomponents version

ui-library 5.5.0

Steps to reproduce
  • Open a page that shows a list of six-tag elements after loading data.
  • Keep the mouse over one of the tags while the page loads.
  • An empty tooltip appears and does not go away.
What is expected?

Should not be any empty tooltip

What is actually happening?

If the user hovers a six-tag while the page is still rendering, an empty tooltip opens and stays open forever, even after moving the mouse away.

Cause:
  1. When a six-tag is created, its inner six-tooltip is enabled and has empty content.
  2. About 0.3 seconds later, six-tag runs updateTooltip(). This sets the tooltip to disabled, because the text is not cut off.
  3. If the user hovered during that 0.3 seconds, the tooltip is already open. Now it is open and disabled.
  4. six-tooltip.hide() does nothing when the tooltip is disabled (six-tooltip.js, line 132: if (!this.isVisible || this.disabled) return). So it can't close.
Image
System Info

Any additional comments?

Suggested fixes (either helps):

Either of these would solve it:

  • Create the inner tooltip in six-tag as disabled from the start. Enable it only when the text really is cut off.
  • Let hide() close a visible tooltip even if it is disabled.

Workaround we tested
This listener makes the problem disappear:

document.addEventListener('six-tooltip-show', e => {
 const tt = e.composedPath()[0];
 if (!tt.content?.trim() && tt.getRootNode().host?.tagName === 'SIX-TAG') e.preventDefault();
}, true);

We would rather not keep this workaround in our code, so we are waiting for your fix.

Impact: it affects every six-tag. It is only cosmetic, so priority is minor.

Link to our test env page where you can reproduce it: ReXplorer TEST

Dominant language
TypeScript
Stars
30
Forks
14
Avg merge
3d 5h
Merged PRs (30d)
5

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from six-group/six-webcomponents

All issues in six-group/six-webcomponents

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.