chore(a11y): cleanup

This commit is contained in:
moklick
2025-06-03 14:04:48 +02:00
parent 1a3e293bf9
commit 65e912a755
2 changed files with 7 additions and 9 deletions
@@ -40,7 +40,7 @@ export function NodeWrapper<NodeType extends Node>({
nodeClickDistance,
onError,
}: NodeWrapperProps<NodeType>) {
const { node, internals, isParent, labelConfig } = useStore((s) => {
const { node, internals, isParent } = useStore((s) => {
const node = s.nodeLookup.get(id)! as InternalNode<NodeType>;
const isParent = s.parentLookup.has(id);
@@ -48,7 +48,6 @@ export function NodeWrapper<NodeType extends Node>({
node,
internals: node.internals,
isParent,
labelConfig: s.labelConfig,
};
}, shallow);
@@ -143,6 +142,8 @@ export function NodeWrapper<NodeType extends Node>({
// prevent default scrolling behavior on arrow key press when node is moved
event.preventDefault();
const { labelConfig } = store.getState();
store.setState({
ariaLiveMessage: labelConfig['a11yDescription.ariaLiveMessage']({
direction: event.key.replace('Arrow', '').toLowerCase(),