feat(PageController): exclude aria-hidden elements
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
* @edit scrollable element detection
|
* @edit scrollable element detection
|
||||||
* @edit add `data-browser-use-ignore` attribute
|
* @edit add `data-browser-use-ignore` attribute
|
||||||
* @edit improve `sampleRect`, filter out rects with 0 area
|
* @edit improve `sampleRect`, filter out rects with 0 area
|
||||||
|
* @edit exclude aria-hidden elements
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default (
|
export default (
|
||||||
@@ -1446,7 +1447,14 @@ export default (
|
|||||||
* @edit add `data-browser-use-ignore` attribute
|
* @edit add `data-browser-use-ignore` attribute
|
||||||
*/
|
*/
|
||||||
if (node.dataset?.browserUseIgnore === 'true') {
|
if (node.dataset?.browserUseIgnore === 'true') {
|
||||||
return true // Skip this node and its children
|
return null // Skip this node and its children
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @edit exclude aria-hidden elements
|
||||||
|
*/
|
||||||
|
if (node.getAttribute && node.getAttribute('aria-hidden') === 'true') {
|
||||||
|
return null // Skip this node and its children
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special handling for root node (body)
|
// Special handling for root node (body)
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ export default function Header() {
|
|||||||
role="navigation"
|
role="navigation"
|
||||||
aria-label={t('header.nav_docs')}
|
aria-label={t('header.nav_docs')}
|
||||||
>
|
>
|
||||||
<span className="text-xs font-mono text-gray-400 dark:text-gray-500 tabular-nums">
|
<span className="text-xs font-mono text-gray-400 dark:text-gray-500 tabular-nums before:content-['v']">
|
||||||
v{import.meta.env.VERSION}
|
{import.meta.env.VERSION}
|
||||||
</span>
|
</span>
|
||||||
<Link
|
<Link
|
||||||
href="/docs/introduction/overview"
|
href="/docs/introduction/overview"
|
||||||
|
|||||||
Reference in New Issue
Block a user