feat(a11y): add aria live message on move by keyboard

This commit is contained in:
moklick
2022-08-16 18:21:20 +02:00
parent ee5352df8f
commit d2d4b76e65
8 changed files with 43 additions and 17 deletions
@@ -91,6 +91,12 @@ export default (NodeComponent: ComponentType<NodeProps>) => {
unselect,
});
} else if (selected && Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {
store.setState({
ariaLiveMessage: `Move selected node ten pixels to the ${event.key
.replace('Arrow', '')
.toLowerCase()}. New position, x: ${xPos}, y: ${yPos}`,
});
updatePositions(arrowKeyDiffs[event.key]);
}
};