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

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

Callers 1

handleIssueClickFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected