Skip to content

AI-native design editor. Open-source Figma alternative.

Add Shift+A shortcut to toggle auto-layout

Danila Poyarkov10c0a39ebe0d
diff --git a/src/composables/use-keyboard.ts b/src/composables/use-keyboard.ts
index e81966b52..4849bb5bb 100644
--- a/src/composables/use-keyboard.ts
+++ b/src/composables/use-keyboard.ts
@@ -71,6 +71,15 @@ export function useKeyboard(store: EditorStore) {
}
}
+ if (e.shiftKey && e.key === 'A') {
+ e.preventDefault()
+ const node = store.selectedNode.value
+ if (node && node.type === 'FRAME') {
+ store.setLayoutMode(node.id, node.layoutMode === 'NONE' ? 'VERTICAL' : 'NONE')
+ }
+ return
+ }
+
if (e.key === 'Backspace' || e.key === 'Delete') {
store.deleteSelected()
}