This repository was archived by the owner on Feb 28, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
frontend/src/components/input Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,10 @@ export interface BaseItem {
1313
1414interface OptionProps {
1515 value : string ;
16+ display ?: string ;
1617}
1718
18- const Option = ( { value } : OptionProps ) : JSX . Element => (
19+ const Option = ( { value, display = value } : OptionProps ) : JSX . Element => (
1920 < Combobox . Option
2021 value = { value }
2122 className = { ( { active } ) =>
@@ -27,7 +28,7 @@ const Option = ({ value }: OptionProps): JSX.Element => (
2728 >
2829 { ( { active, selected } ) => (
2930 < >
30- < span className = { classNames ( 'block truncate' , selected && 'font-semibold' ) } > { value } </ span >
31+ < span className = { classNames ( 'block truncate' , selected && 'font-semibold' ) } > { display } </ span >
3132
3233 { selected && (
3334 < span
@@ -140,7 +141,7 @@ const AutoCompleteSelect = <Item extends BaseItem>({
140141 { options . map ( ( option ) => (
141142 < Option key = { option } value = { option } />
142143 ) ) }
143- { allowArbitrary && < Option value = { `Add "${ query } "...` } /> }
144+ { allowArbitrary && < Option display = { `Add "${ query } "...` } value = { query } /> }
144145 </ Combobox . Options >
145146 ) }
146147 </ div >
You can’t perform that action at this time.
0 commit comments