fix(nc-gui): alt+b shortcut issue

This commit is contained in:
Ramesh Mane
2025-05-17 06:32:01 +00:00
parent ca924a5739
commit 12c6eebc90
4 changed files with 62 additions and 36 deletions

View File

@@ -0,0 +1,39 @@
<script lang="ts" setup>
interface Props {
value: string
}
const props = defineProps<Props>()
const emits = defineEmits<{
(e: 'update:value', value: string): void
}>()
const vModel = useVModel(props, 'value', emits)
const inputRef = ref()
const onKeydown = (e: KeyboardEvent) => {
if (e.altKey && e.code === 'KeyB') {
inputRef.value.input?.blur()
} else {
e.stopPropagation()
}
}
</script>
<template>
<a-input
ref="inputRef"
v-model:value="vModel"
@keydown="onKeydown"
type="text"
class="nc-base-search-input nc-input-border-on-value nc-input-shadow !h-8 !px-2.5 !py-1 !rounded-lg"
:placeholder="`${$t('activity.searchProject').charAt(0).toUpperCase()}${$t('activity.searchProject').slice(1).toLowerCase()}`"
allow-clear
>
<template #prefix>
<GeneralIcon icon="search" class="mr-1 h-4 w-4 text-gray-500 group-hover:text-black" />
</template>
</a-input>
</template>