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

Function scrollToElement

packages/devtools-a11y/src/core/utils/ui.utils.ts:8–23  ·  view source on GitHub ↗
(selector: string)

Source from the content-addressed store, hash-verified

6 A11yIssue,
7 RuleSetPreset,
8 SeverityThreshold,
9} from '../types/types'
10
11export function scrollToElement(selector: string): boolean {
12 try {
13 const element = document.querySelector(selector)
14 if (element) {
15 element.scrollIntoView({
16 behavior: 'smooth',
17 block: 'start',
18 inline: 'nearest',
19 })
20 return true
21 }
22 } catch (error) {
23 console.warn('[A11y Panel] Could not scroll to element:', selector, error)
24 }
25 return false
26}

Callers 1

handleIssueClickFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected