Skip to content

Commit 8101a4c

Browse files
committed
chore: lots of logic
1 parent 9a4d6d3 commit 8101a4c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/SelectInput/Content/SingleContent.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import * as React from 'react';
22
import Input from '../Input';
33
import { useSelectInputContext } from '../context';
4+
import useBaseProps from '../../hooks/useBaseProps';
45
import Placeholder from './Placeholder';
56
import type { SharedContentProps } from '.';
67

78
export default React.forwardRef<HTMLInputElement, SharedContentProps>(function SingleContent(
89
{ inputProps },
910
ref,
1011
) {
11-
const { prefixCls, searchValue, activeValue, displayValues, maxLength, mode, onSearch } =
12+
const { prefixCls, searchValue, activeValue, displayValues, maxLength, mode } =
1213
useSelectInputContext();
14+
const { triggerOpen } = useBaseProps();
1315

1416
const [inputChanged, setInputChanged] = React.useState(false);
1517

@@ -18,7 +20,7 @@ export default React.forwardRef<HTMLInputElement, SharedContentProps>(function S
1820

1921
// Implement the same logic as the old SingleSelector
2022
let mergedSearchValue: string = searchValue || '';
21-
if (combobox && activeValue && !inputChanged) {
23+
if (combobox && activeValue && !inputChanged && triggerOpen) {
2224
mergedSearchValue = activeValue;
2325
}
2426

0 commit comments

Comments
 (0)