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 8ab5455 commit 51cb497
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 51cb497

Please sign in to comment.