From 277aa30b07544fe362f851c9d8ad17172ce70097 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 23 Aug 2023 15:41:45 +0100 Subject: [PATCH] Fix keyboard actions for screen and nav --- packages/builder/src/builderStore/index.js | 4 ++-- packages/builder/src/builderStore/store/frontend.js | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/builderStore/index.js b/packages/builder/src/builderStore/index.js index dfb8609e65..eecccab7a6 100644 --- a/packages/builder/src/builderStore/index.js +++ b/packages/builder/src/builderStore/index.js @@ -63,9 +63,9 @@ export const selectedComponent = derived( ([$store, $selectedScreen]) => { if ( $selectedScreen && - ["navigation", "screen"].includes($store.selectedComponentId) + $store.selectedComponentId?.startsWith(`${$selectedScreen._id}-`) ) { - return findComponent($selectedScreen?.props, $selectedScreen?.props._id) + return $selectedScreen?.props } if (!$selectedScreen || !$store.selectedComponentId) { return null diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 9c52a52b47..8f4f6cc2c4 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -1002,7 +1002,6 @@ export const getFrontendStore = () => { // Check for screen and navigation component edge cases const screenComponentId = `${screen._id}-screen` const navComponentId = `${screen._id}-navigation` - console.log(componentId, screenComponentId, navComponentId) if (componentId === screenComponentId) { return null } @@ -1083,7 +1082,6 @@ export const getFrontendStore = () => { } }, selectPrevious: () => { - console.log("prev") const previousId = store.actions.components.getPrevious() if (previousId) { store.update(state => { @@ -1093,7 +1091,6 @@ export const getFrontendStore = () => { } }, selectNext: () => { - console.log("next") const nextId = store.actions.components.getNext() if (nextId) { store.update(state => {