Fixed object type search bug

This commit is contained in:
Tom Butcher 2025-11-23 13:22:21 +00:00
parent aeebaaddda
commit b12d230a8e

View File

@ -17,7 +17,8 @@ const ObjectTypeSelect = ({
.sort((a, b) => a.label.localeCompare(b.label))
.map((model) => ({
value: model.name,
label: <ObjectTypeDisplay objectType={model.name} />
label: <ObjectTypeDisplay objectType={model.name} />,
searchText: model.label?.toLowerCase() || ''
}))
return (
@ -31,9 +32,7 @@ const ObjectTypeSelect = ({
allowClear={allowClear}
disabled={disabled}
filterOption={(input, option) =>
option.label.props.children[1].props.children
.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
option.searchText?.includes(input.toLowerCase()) ?? false
}
options={options}
/>