mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-30 15:06:38 +00:00
fix(nc-gui): alt+b shortcut issue
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user