-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial live region support (#33)
* feat: first pass live region support * feat: implicit live region roles --------- Co-authored-by: jlp-craigmorten <craig.morten@waitrose.co.uk>
- Loading branch information
1 parent
6425855
commit f431795
Showing
24 changed files
with
2,488 additions
and
724 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
import { AccessibilityNode } from "../createAccessibilityTree"; | ||
import { isElement } from "../isElement"; | ||
import { getElementFromNode } from "../getElementFromNode"; | ||
|
||
export function getElementNode(accessibilityNode: AccessibilityNode) { | ||
export function getElementNode(accessibilityNode: AccessibilityNode): Element { | ||
const { node } = accessibilityNode; | ||
|
||
if (node && isElement(node)) { | ||
return node; | ||
} | ||
|
||
return accessibilityNode.parent; | ||
return getElementFromNode(node); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { isElement } from "./isElement"; | ||
|
||
export const getElementFromNode = (node: Node): HTMLElement => { | ||
return isElement(node) ? node : node.parentElement; | ||
}; |
Oops, something went wrong.