Skip to content

Commit 600b258

Browse files
committed
fix: remove selection overlay hover tooltips
1 parent f551373 commit 600b258

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

client/src/features/accessibility/AccessibilityOverlay.test.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { describe, expect, it } from "vitest";
2+
import { createElement } from "react";
3+
import { renderToStaticMarkup } from "react-dom/server";
24

3-
import { accessibilityDomTagName } from "./AccessibilityOverlay";
5+
import {
6+
AccessibilityOverlay,
7+
accessibilityDomTagName,
8+
} from "./AccessibilityOverlay";
49

510
describe("accessibilityDomTagName", () => {
611
it("uses source and component names for annotator-friendly custom tags", () => {
@@ -24,3 +29,30 @@ describe("accessibilityDomTagName", () => {
2429
).toBe("simdeck-range-and-filter-bar");
2530
});
2631
});
32+
33+
describe("AccessibilityOverlay", () => {
34+
it("does not attach browser-native hover tooltips to selection nodes", () => {
35+
const markup = renderToStaticMarkup(
36+
createElement(AccessibilityOverlay, {
37+
hoveredId: null,
38+
roots: [
39+
{
40+
frame: { height: 844, width: 390, x: 0, y: 0 },
41+
role: "application",
42+
children: [
43+
{
44+
AXLabel: "Continue",
45+
frame: { height: 48, width: 180, x: 105, y: 720 },
46+
type: "Button",
47+
},
48+
],
49+
},
50+
],
51+
selectedId: "",
52+
}),
53+
);
54+
55+
expect(markup).toContain('aria-label="SimDeck accessibility element');
56+
expect(markup).not.toContain(" title=");
57+
});
58+
});

client/src/features/accessibility/AccessibilityOverlay.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ function AccessibilityDomNode({
172172
"data-simdeck-accessibility-value": metadata.value,
173173
"data-simdeck-inspector-id": node.inspectorId || undefined,
174174
"data-simdeck-uikit-id": node.uikitId || undefined,
175-
title: label,
176175
role,
177176
style: frameStyle(node.frame, rootFrame),
178177
});

0 commit comments

Comments
 (0)