diff --git a/apps/nextjs-app/src/features/app/blocks/view/search/SearchButton.tsx b/apps/nextjs-app/src/features/app/blocks/view/search/SearchButton.tsx index 2fda12ade..10cdc975e 100644 --- a/apps/nextjs-app/src/features/app/blocks/view/search/SearchButton.tsx +++ b/apps/nextjs-app/src/features/app/blocks/view/search/SearchButton.tsx @@ -27,7 +27,6 @@ export const SearchButton = (props: ISearchButtonProps) => { const tableId = useTableId(); const view = useView(); const { fieldId, value, setFieldId, setValue, hideNotMatchRow, setHideNotMatchRow } = useSearch(); - console.log('fieldId', fieldId); const [inputValue, setInputValue] = useState(value); const [isFocused, setIsFocused] = useState(false); const { t } = useTranslation(['common', 'table']); diff --git a/apps/nextjs-app/src/features/app/blocks/view/search/SearchCommand.tsx b/apps/nextjs-app/src/features/app/blocks/view/search/SearchCommand.tsx index 1bbabc21d..e9fb7c2c3 100644 --- a/apps/nextjs-app/src/features/app/blocks/view/search/SearchCommand.tsx +++ b/apps/nextjs-app/src/features/app/blocks/view/search/SearchCommand.tsx @@ -14,7 +14,7 @@ import { Toggle, } from '@teable/ui-lib'; import { useTranslation } from 'next-i18next'; -import { useCallback, useMemo } from 'react'; +import { useCallback, useMemo, useState } from 'react'; interface ISearchCommand { value: string; @@ -56,6 +56,8 @@ export const SearchCommand = (props: ISearchCommand) => { const enableGlobalSearch = value === 'all_fields'; + const [filterText, setFilterText] = useState(''); + return ( { @@ -64,6 +66,10 @@ export const SearchCommand = (props: ISearchCommand) => { placeholder={t('actions.search')} className="h-8 text-xs" disabled={enableGlobalSearch} + value={filterText} + onValueChange={(value) => { + setFilterText(value); + }} /> {{t('listEmptyTips')}} @@ -124,6 +130,7 @@ export const SearchCommand = (props: ISearchCommand) => { pressed={enableGlobalSearch} onPressedChange={() => { onChange(['all_fields']); + setFilterText(''); }} size={'sm'} className="flex flex-1 items-center truncate p-0"