1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13: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]) componentTreeNodesStore.expandNodes([component._id])
}, },
["ArrowLeft"]: component => { ["ArrowLeft"]: component => {
// Select the collapsing root component to ensure the currently selected component is not
// hidden in a collapsed node
componentStore.select(component._id) componentStore.select(component._id)
componentTreeNodesStore.collapseNodes([component._id]) componentTreeNodesStore.collapseNodes([component._id])
}, },
@ -74,8 +76,8 @@
componentTreeNodesStore.expandNodes(childIds) componentTreeNodesStore.expandNodes(childIds)
}, },
["Ctrl+ArrowLeft"]: component => { ["Ctrl+ArrowLeft"]: component => {
// Select the collapsing root component to ensure the currently selected component is hidden // Select the collapsing root component to ensure the currently selected component is not
// due to this action // hidden in a collapsed node
componentStore.select(component._id) componentStore.select(component._id)
const childIds = getChildIdsForComponent(component) const childIds = getChildIdsForComponent(component)

View file

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