Skip to content

Commit

Permalink
feat(persons): allow search for talk titles in speakers catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Dec 14, 2024
1 parent 8c40aef commit 84700a2
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,21 @@ const SpeakerEditView = ({ speaker }: SpeakerEditViewType) => {
getOptionLabel={(option: PublicTalkType) =>
option.talk_number.toString()
}
filterOptions={(options, params) => {
const inputValue = params.inputValue.toLowerCase();

return options.filter((record) => {
const numberMatch = record.talk_number
.toString()
.includes(inputValue);

const titleMatch = record.talk_title
.toLowerCase()
.includes(inputValue);

return numberMatch || titleMatch;
});
}}
value={selectedTalks}
onChange={(e, value: PublicTalkType[]) => handleTalksUpdate(value)}
renderOption={(props, option) => (
Expand Down

0 comments on commit 84700a2

Please sign in to comment.