MCPcopy Create free account
hub / github.com/TanStack/devtools / A11yIssueList

Function A11yIssueList

packages/devtools-a11y/src/core/components/IssueList.tsx:23–155  ·  view source on GitHub ↗
(props: A11yIssueListProps)

Source from the content-addressed store, hash-verified

21}
22
23export function A11yIssueList(props: A11yIssueListProps) {
24 const [selectedIssueId, setSelectedIssueId] = props.selectedIssueSignal
25
26 // hooks
27 const styles = createStyles()
28 const ally = createAllyContext()
29
30 // handlers
31 const handleIssueClick = (issueId: string) => {
32 if (selectedIssueId() === issueId) {
33 setSelectedIssueId('')
34 clearHighlights()
35
36 if (
37 ally.config.showOverlays &&
38 ally.allyResult.audit &&
39 ally.filteredIssues().length > 0
40 ) {
41 highlightAllIssues(ally.filteredIssues())
42 }
43
44 return
45 }
46
47 setSelectedIssueId(issueId)
48 clearHighlights()
49
50 const issue = ally.allyResult.audit?.issues.find((i) => i.id === issueId)
51 if (!issue || issue.nodes.length === 0) return
52
53 let scrolled = false
54 for (const node of issue.nodes) {
55 const selector = node.selector
56 if (!selector) continue
57
58 try {
59 const el = document.querySelector(selector)
60 if (el) {
61 if (!scrolled) {
62 scrollToElement(selector)
63 scrolled = true
64 }
65
66 highlightElement(selector, issue.impact, {
67 showTooltip: true,
68 ruleId: issue.ruleId,
69 })
70 }
71 } catch (error) {
72 console.warn('[A11y Panel] Invalid selector:', selector, error)
73 }
74 }
75 }
76
77 return (
78 <div>
79 <div class={styles().summaryGrid}>
80 <For each={IMPACTS}>

Callers

nothing calls this directly

Calls 8

createStylesFunction · 0.90
createAllyContextFunction · 0.90
activeFunction · 0.85
countFunction · 0.85
shouldRenderFunction · 0.85
issuesFunction · 0.85
handleIssueClickFunction · 0.85
setConfigMethod · 0.80

Tested by

no test coverage detected