fix(nodes): blur when node gets unselected closes #2887, closes #2886

This commit is contained in:
moklick
2023-03-06 16:35:24 +01:00
parent f62fc8933f
commit 7383200388
3 changed files with 9 additions and 4 deletions
@@ -74,6 +74,7 @@ export default (NodeComponent: ComponentType<NodeProps>) => {
handleNodeClick({
id,
store,
nodeRef,
});
}
@@ -90,13 +91,12 @@ export default (NodeComponent: ComponentType<NodeProps>) => {
if (elementSelectionKeys.includes(event.key) && isSelectable) {
const unselect = event.key === 'Escape';
if (unselect) {
nodeRef.current?.blur();
}
handleNodeClick({
id,
store,
unselect,
nodeRef,
});
} else if (
!disableKeyboardA11y &&