Skip to content

Commit

Permalink
fix(form): fix select keyword lose
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Sep 14, 2022
1 parent bcbdbf6 commit 797f853
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/field/src/components/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {
RequestOptionsType,
} from '@ant-design/pro-utils';
import {
useSafeState,
nanoid,
useDebounceValue,
useDeepCompareEffect,
Expand Down Expand Up @@ -290,7 +291,7 @@ export const useFieldFetchData = (
): [boolean, SelectOptionType, (keyWord?: string) => void, () => void] => {
const { cacheForSwr, fieldProps } = props;

const [keyWords, setKeyWords] = useState<string | undefined>(props.defaultKeyWords);
const [keyWords, setKeyWords] = useSafeState<string | undefined>(props.defaultKeyWords);
/** Key 是用来缓存请求的,如果不在是有问题 */
const [cacheKey] = useState(() => {
if (props.proFieldKey) {
Expand Down

0 comments on commit 797f853

Please sign in to comment.