I can select range with visual feedback

This commit is contained in:
2026-02-10 23:00:45 +01:00
parent 79c37493af
commit 520a8914fc
7 changed files with 353 additions and 25 deletions

View File

@@ -186,8 +186,10 @@ function bindTooltipsWithDelegation(elementId) {
// Add a single mouseenter and mouseleave listener to the parent element
element.addEventListener("mouseenter", (event) => {
// Early exit - check mf-no-tooltip FIRST (before any DOM work)
if (element.hasAttribute("mf-no-tooltip")) {
const target = event.target;
// Early exit - check mf-no-tooltip on the registered element OR any ancestor of the target
if (element.hasAttribute("mf-no-tooltip") || target.closest("[mf-no-tooltip]")) {
return;
}
@@ -196,7 +198,7 @@ function bindTooltipsWithDelegation(elementId) {
return;
}
const cell = event.target.closest("[data-tooltip]");
const cell = target.closest("[data-tooltip]");
if (!cell) {
return;
}
@@ -207,7 +209,7 @@ function bindTooltipsWithDelegation(elementId) {
tooltipRafScheduled = false;
// Check again in case tooltip was disabled during RAF delay
if (element.hasAttribute("mf-no-tooltip")) {
if (element.hasAttribute("mf-no-tooltip") || target.closest("[mf-no-tooltip]")) {
return;
}