(selector: string)
| 6 | A11yIssue, |
| 7 | RuleSetPreset, |
| 8 | SeverityThreshold, |
| 9 | } from '../types/types' |
| 10 | |
| 11 | export 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 | } |