Fixed object type search bug
This commit is contained in:
parent
aeebaaddda
commit
b12d230a8e
@ -17,7 +17,8 @@ const ObjectTypeSelect = ({
|
|||||||
.sort((a, b) => a.label.localeCompare(b.label))
|
.sort((a, b) => a.label.localeCompare(b.label))
|
||||||
.map((model) => ({
|
.map((model) => ({
|
||||||
value: model.name,
|
value: model.name,
|
||||||
label: <ObjectTypeDisplay objectType={model.name} />
|
label: <ObjectTypeDisplay objectType={model.name} />,
|
||||||
|
searchText: model.label?.toLowerCase() || ''
|
||||||
}))
|
}))
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -31,9 +32,7 @@ const ObjectTypeSelect = ({
|
|||||||
allowClear={allowClear}
|
allowClear={allowClear}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
filterOption={(input, option) =>
|
filterOption={(input, option) =>
|
||||||
option.label.props.children[1].props.children
|
option.searchText?.includes(input.toLowerCase()) ?? false
|
||||||
.toLowerCase()
|
|
||||||
.indexOf(input.toLowerCase()) >= 0
|
|
||||||
}
|
}
|
||||||
options={options}
|
options={options}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user