1
0
Fork 0
mirror of synced 2024-07-04 05:50:57 +12:00
This commit is contained in:
Gerard Burns 2024-03-14 15:57:18 +00:00
parent 61f2746cf9
commit 49c104d762
2 changed files with 10 additions and 3 deletions

View file

@ -66,6 +66,8 @@
componentTreeNodesStore.expandNodes([component._id])
},
["ArrowLeft"]: component => {
// Select the collapsing root component to ensure the currently selected component is not
// hidden in a collapsed node
componentStore.select(component._id)
componentTreeNodesStore.collapseNodes([component._id])
},
@ -74,8 +76,8 @@
componentTreeNodesStore.expandNodes(childIds)
},
["Ctrl+ArrowLeft"]: component => {
// Select the collapsing root component to ensure the currently selected component is hidden
// due to this action
// Select the collapsing root component to ensure the currently selected component is not
// hidden in a collapsed node
componentStore.select(component._id)
const childIds = getChildIdsForComponent(component)

View file

@ -79,6 +79,11 @@
return findComponentPath($selectedComponent, component._id)?.length > 0
}
const handleIconClick = (componentId) => {
componentStore.select(componentId)
componentTreeNodesStore.toggleNode(componentId)
}
const hover = hoverStore.hover
</script>
@ -100,7 +105,7 @@
on:dragend={dndStore.actions.reset}
on:dragstart={() => dndStore.actions.dragstart(component)}
on:dragover={dragover(component, index)}
on:iconClick={() => componentTreeNodesStore.toggleNode(component._id)}
on:iconClick={() => handleIconClick(component._id)}
on:drop={onDrop}
hovering={$hoverStore.componentId === component._id}
on:mouseenter={() => hover(component._id)}