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)) .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}
/> />