diff --git a/docs/app/components/content/examples/context-menu/ContextMenuCheckboxItemsExample.vue b/docs/app/components/content/examples/context-menu/ContextMenuCheckboxItemsExample.vue index ea6c558c..1859d4af 100644 --- a/docs/app/components/content/examples/context-menu/ContextMenuCheckboxItemsExample.vue +++ b/docs/app/components/content/examples/context-menu/ContextMenuCheckboxItemsExample.vue @@ -14,8 +14,8 @@ const items = computed(() => [{ onUpdateChecked(checked: boolean) { showSidebar.value = checked }, - onSelect(e?: Event) { - e?.preventDefault() + onSelect(e: Event) { + e.preventDefault() } }, { label: 'Show Toolbar', diff --git a/docs/app/components/content/examples/dropdown-menu/DropdownMenuCheckboxItemsExample.vue b/docs/app/components/content/examples/dropdown-menu/DropdownMenuCheckboxItemsExample.vue index fe9b2f40..4e427694 100644 --- a/docs/app/components/content/examples/dropdown-menu/DropdownMenuCheckboxItemsExample.vue +++ b/docs/app/components/content/examples/dropdown-menu/DropdownMenuCheckboxItemsExample.vue @@ -17,8 +17,8 @@ const items = computed(() => [{ onUpdateChecked(checked: boolean) { showBookmarks.value = checked }, - onSelect(e?: Event) { - e?.preventDefault() + onSelect(e: Event) { + e.preventDefault() } }, { label: 'Show History', diff --git a/playground/app/pages/components/command-palette.vue b/playground/app/pages/components/command-palette.vue index ab350dd7..37bc9031 100644 --- a/playground/app/pages/components/command-palette.vue +++ b/playground/app/pages/components/command-palette.vue @@ -33,7 +33,8 @@ const groups = computed(() => [{ icon: 'i-heroicons-document-plus', loading: loading.value, onSelect(e: Event) { - e?.preventDefault() + e.preventDefault() + toast.add({ title: 'New file added!' }) loading.value = true @@ -48,7 +49,8 @@ const groups = computed(() => [{ suffix: 'Create a new folder in the current directory or workspace.', icon: 'i-heroicons-folder-plus', onSelect(e: Event) { - e?.preventDefault() + e.preventDefault() + toast.add({ title: 'New folder added!' }) }, kbds: ['meta', 'F'] @@ -57,7 +59,8 @@ const groups = computed(() => [{ suffix: 'Add a hashtag to the current item.', icon: 'i-heroicons-hashtag', onSelect(e: Event) { - e?.preventDefault() + e.preventDefault() + toast.add({ title: 'Hashtag added!' }) }, kbds: ['meta', 'H'] @@ -66,7 +69,8 @@ const groups = computed(() => [{ suffix: 'Add a label to the current item.', icon: 'i-heroicons-tag', onSelect(e: Event) { - e?.preventDefault() + e.preventDefault() + toast.add({ title: 'Label added!' }) }, kbds: ['meta', 'L'] diff --git a/playground/app/pages/components/context-menu.vue b/playground/app/pages/components/context-menu.vue index 6deed524..3afa2ed1 100644 --- a/playground/app/pages/components/context-menu.vue +++ b/playground/app/pages/components/context-menu.vue @@ -1,9 +1,12 @@