File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/components/breadcrumb Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1111</template >
1212
1313<script setup lang="ts">
14+ import { useEventListener } from ' @vueuse/core'
1415import Breadcrumb from ' primevue/breadcrumb'
1516import type { MenuItem , MenuItemCommandEvent } from ' primevue/menuitem'
1617import { computed } from ' vue'
@@ -52,6 +53,18 @@ const home = computed(() => ({
5253const handleItemClick = (event : MenuItemCommandEvent ) => {
5354 event .item .command ?.(event )
5455}
56+
57+ // Escape exits from the current subgraph.
58+ useEventListener (document , ' keydown' , (event ) => {
59+ if (event .key === ' Escape' ) {
60+ const canvas = useCanvasStore ().getCanvas ()
61+ if (! canvas .graph ) throw new TypeError (' Canvas has no graph' )
62+
63+ canvas .setGraph (
64+ navigationStore .navigationStack .at (- 2 ) ?? canvas .graph .rootGraph
65+ )
66+ }
67+ })
5568 </script >
5669
5770<style >
You can’t perform that action at this time.
0 commit comments