Skip to content

Commit

Permalink
fix: type to search
Browse files Browse the repository at this point in the history
  • Loading branch information
jaieds committed Nov 15, 2024
1 parent f6bcde7 commit 5401c60
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/select/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export function SelectButton( {

export function SelectOptions( {
children,
searchBy = 'id', // Used to identify searched value using the key. Default is 'id'.
searchBy = 'name', // Used to identify searched value using the key. Default is 'id'.
searchPlaceholder = 'Search...', // Placeholder text for search box.
className, // Additional class name for the dropdown.
}: SelectOptionsProps ) {
Expand Down Expand Up @@ -382,7 +382,11 @@ export function SelectOptions( {
}
}

listContentRef.current.push( child.props.value );
listContentRef.current.push(
typeof child.props.value === 'object'
? child.props.value[ searchBy || by ]
: child.props.value
);
}
} );
}, [ searchKeyword ] );
Expand Down

0 comments on commit 5401c60

Please sign in to comment.