Commit ae19274c authored by 前端-许佳敏's avatar 前端-许佳敏

fix:修复searchSelect在单选下无法关闭

parent 1610bddb
...@@ -116,6 +116,10 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => { ...@@ -116,6 +116,10 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => {
// } // }
// const { run } = useDebounceFn(dispatchSearch, 500) // const { run } = useDebounceFn(dispatchSearch, 500)
const multipleProps = multiple ? {
open: openSelect,
onFocus: () => setOpenSelect(true),
} : {}
return ( return (
<Select <Select
ref={ref} ref={ref}
...@@ -124,10 +128,9 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => { ...@@ -124,10 +128,9 @@ const SearchSelect = (props: ISchemaFieldComponentProps) => {
filterOption={false} filterOption={false}
loading={loading} loading={loading}
options={dataSource} options={dataSource}
onFocus={() => setOpenSelect(true)}
value={props.value} value={props.value}
open={multiple ? openSelect : null}
dropdownRender={originNode => <SelectContent confirm={confirm} resetField={resetField} parentRef={ref} handleChange={handleChange} multiple={multiple} value={props.value}>{originNode}</SelectContent>} dropdownRender={originNode => <SelectContent confirm={confirm} resetField={resetField} parentRef={ref} handleChange={handleChange} multiple={multiple} value={props.value}>{originNode}</SelectContent>}
{...multipleProps}
{...resetProps} {...resetProps}
> >
</Select> </Select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment