update: use store injection in UserSelection component

fix: keypress not displaying working properly
This commit is contained in:
Braks
2021-07-14 23:48:19 +02:00
parent f5580b6d96
commit c7fda830a6
9 changed files with 83 additions and 72 deletions
+2 -3
View File
@@ -157,8 +157,7 @@ const FlowRenderer = defineComponent({
},
setup(props, { slots }) {
const store = inject<RevueFlowStore>('store');
const selectionKeyPressed = useKeyPress(props.selectionKeyCode);
const keyPressed = useKeyPress(props.selectionKeyCode);
useGlobalKeyHandler({
onElementsRemove: props.onElementsRemove,
@@ -200,7 +199,7 @@ const FlowRenderer = defineComponent({
zoomActivationKeyCode={props.zoomActivationKeyCode}
>
{slots.default ? slots.default() : ''}
<UserSelection selectionKeyPressed={selectionKeyPressed} />
{keyPressed.value ? <UserSelection selectionKeyPressed={keyPressed.value} /> : ''}
{store?.nodesSelectionActive && (
<NodesSelection
onSelectionDragStart={props.onSelectionDragStart}