diff --git a/client/src/components/History/Multiple/MultipleViewList.vue b/client/src/components/History/Multiple/MultipleViewList.vue index f32bb12449e3..3b31c5e20f97 100644 --- a/client/src/components/History/Multiple/MultipleViewList.vue +++ b/client/src/components/History/Multiple/MultipleViewList.vue @@ -32,6 +32,11 @@ const props = withDefaults( } ); +// defineEmits below +const emit = defineEmits<{ + (e: "update:show-modal", value: boolean): void; +}>(); + const scrollContainer: Ref = ref(null); const { arrived } = useAnimationFrameScroll(scrollContainer); @@ -99,9 +104,20 @@ async function onDrop(evt: any) { processingDrop.value = false; } } + +async function onKeyDown(evt: KeyboardEvent) { + if (evt.key === "Enter" || evt.key === " ") { + if ((evt.target as HTMLElement)?.classList?.contains("top-picker")) { + await createAndPin(); + } else if ((evt.target as HTMLElement)?.classList?.contains("bottom-picker")) { + emit("update:show-modal", true); + } + } +}