Fix keyboard actions for screen and nav

This commit is contained in:
Andrew Kingston 2023-08-23 15:41:45 +01:00
parent 0ef0e58e5e
commit 277aa30b07
2 changed files with 2 additions and 5 deletions

View File

@ -63,9 +63,9 @@ export const selectedComponent = derived(
([$store, $selectedScreen]) => { ([$store, $selectedScreen]) => {
if ( if (
$selectedScreen && $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) { if (!$selectedScreen || !$store.selectedComponentId) {
return null return null

View File

@ -1002,7 +1002,6 @@ export const getFrontendStore = () => {
// Check for screen and navigation component edge cases // Check for screen and navigation component edge cases
const screenComponentId = `${screen._id}-screen` const screenComponentId = `${screen._id}-screen`
const navComponentId = `${screen._id}-navigation` const navComponentId = `${screen._id}-navigation`
console.log(componentId, screenComponentId, navComponentId)
if (componentId === screenComponentId) { if (componentId === screenComponentId) {
return null return null
} }
@ -1083,7 +1082,6 @@ export const getFrontendStore = () => {
} }
}, },
selectPrevious: () => { selectPrevious: () => {
console.log("prev")
const previousId = store.actions.components.getPrevious() const previousId = store.actions.components.getPrevious()
if (previousId) { if (previousId) {
store.update(state => { store.update(state => {
@ -1093,7 +1091,6 @@ export const getFrontendStore = () => {
} }
}, },
selectNext: () => { selectNext: () => {
console.log("next")
const nextId = store.actions.components.getNext() const nextId = store.actions.components.getNext()
if (nextId) { if (nextId) {
store.update(state => { store.update(state => {