Browse Source

Merge pull request #3965 from nocodb/fix/filter-search

fix(nc-gui): filter options by label
pull/3975/head
աɨռɢӄաօռɢ 2 years ago committed by GitHub
parent
commit
442fc5a629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue

6
packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue

@ -44,9 +44,7 @@ const options = computed<SelectProps['options']>(() =>
})), })),
) )
const filterOption = (input: string, option: any) => { const filterOption = (input: string, option: any) => option.label.toLowerCase()?.includes(input.toLowerCase())
return option.value.toLowerCase()?.includes(input.toLowerCase())
}
</script> </script>
<template> <template>
@ -58,7 +56,7 @@ const filterOption = (input: string, option: any) => {
:filter-option="filterOption" :filter-option="filterOption"
dropdown-class-name="nc-dropdown-toolbar-field-list" dropdown-class-name="nc-dropdown-toolbar-field-list"
> >
<a-select-option v-for="option in options" :key="option.value" :value="option.value"> <a-select-option v-for="option in options" :key="option.value" :label="option.label" :value="option.value">
<div class="flex gap-2 items-center items-center h-full"> <div class="flex gap-2 items-center items-center h-full">
<component :is="option.icon" class="min-w-5 !mx-0" /> <component :is="option.icon" class="min-w-5 !mx-0" />

Loading…
Cancel
Save