Skip to content

Fix custom tooltip showing "null" on sliders with child elements#5580

Open
pReya wants to merge 1 commit intowled:mainfrom
pReya:fix/null-tooltip-slider
Open

Fix custom tooltip showing "null" on sliders with child elements#5580
pReya wants to merge 1 commit intowled:mainfrom
pReya:fix/null-tooltip-slider

Conversation

@pReya
Copy link
Copy Markdown

@pReya pReya commented May 7, 2026

closes #5578

Summary

  • Switch the custom tooltip handler in index.js from pointerover/pointerout to pointerenter/pointerleave so it fires exactly once per real entry/exit.

Problem

The custom tooltip implementation at wled00/data/index.js saves an element's title attribute to data-title on hover, removes title (to suppress the native browser tooltip), and restores it from data-title on exit.

Because pointerover bubbles, the handler fired again whenever the cursor crossed onto a child element (e.g. moving from the sliderwrap div onto its or .sliderdisplay child). On that second invocation getAttribute("title") returned null (it had already been removed), and setAttribute("data-title", null) stored the literal string "null". Subsequent hovers then displayed a tooltip reading "null".

This was reproducible on the Value/Brightness slider on the Colors tab, and could affect any element with a title attribute that contains child nodes the cursor can land on.

Fix

pointerenter/pointerleave do not bubble — they fire only on the actual entry to and exit from the listening element, regardless of internal cursor movement. This makes the handler idempotent for a single hover and matches the intended semantics.

AI Disclaimer: Claude Code was used to find and fix this bug and create this PR description. However it's not "vibe coded" as I understand the code completely and have reviewed and tested it manually.

Summary by CodeRabbit

  • Bug Fixes
    • Improved tooltip event handling to prevent unintended tooltip triggers and dismissals in edge cases.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 380c0fe9-fbc3-40cb-a4cc-f1adf81dd8f1

📥 Commits

Reviewing files that changed from the base of the PR and between f82ab3c and fdd47a7.

📒 Files selected for processing (1)
  • wled00/data/index.js

Walkthrough

Tooltip event handlers in the UI are updated to use pointerenter and pointerleave instead of pointerover and pointerout. The tooltip creation, positioning, and title restoration logic remains unchanged.

Changes

Tooltip Event Handler Refinement

Layer / File(s) Summary
Tooltip Event Handlers
wled00/data/index.js
Tooltip show event listener switches from pointerover to pointerenter (line 3184). Tooltip hide/cleanup listener switches from pointerout to pointerleave with title restoration logic preserved (lines 3209–3212).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the fix: changing event handlers to prevent 'null' tooltips on sliders with child elements.
Linked Issues check ✅ Passed The code change addresses the root cause of issue #5578 by switching from pointerover/pointerout to pointerenter/pointerleave events to prevent storing 'null' in tooltips.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the tooltip issue reported in #5578; no unrelated modifications are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pReya pReya force-pushed the fix/null-tooltip-slider branch from f82ab3c to b6335d3 Compare May 7, 2026 21:53
@pReya pReya force-pushed the fix/null-tooltip-slider branch from b6335d3 to fdd47a7 Compare May 7, 2026 21:54
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.

Tooltip on top slider shows "null"

1 participant