diff --git a/src/components/Attendees/PeopleSearch.tsx b/src/components/Attendees/PeopleSearch.tsx index 50c3905..289f235 100644 --- a/src/components/Attendees/PeopleSearch.tsx +++ b/src/components/Attendees/PeopleSearch.tsx @@ -273,6 +273,9 @@ export function PeopleSearch({ onChange(event, mapped); }} slotProps={customSlotProps} + // When render input is custom, the adornments should be handled by the custom component + forcePopupIcon={!customRenderInput} + disableClearable={!!customRenderInput} renderInput={(params) => customRenderInput ? customRenderInput(params, query, setQuery) diff --git a/src/components/Menubar/EventSearchBar.tsx b/src/components/Menubar/EventSearchBar.tsx index f8c4bf7..c9dd23e 100644 --- a/src/components/Menubar/EventSearchBar.tsx +++ b/src/components/Menubar/EventSearchBar.tsx @@ -312,44 +312,42 @@ export default function SearchBar() { ), endAdornment: ( - <> - {params.InputProps.endAdornment} - + + {(query || selectedContacts.length > 0) && ( e.preventDefault()} + aria-label={t("common.clear")} onClick={() => { - setAnchorEl(containerRef.current); - handleFilterChange("keywords", query); - handleFilterChange( - "organizers", - selectedContacts.map((a: User) => ({ - cn: a.displayName, - cal_address: a.email || "", - partstat: "NEEDS-ACTION", - rsvp: "FALSE", - role: "REQ-PARTICIPANT", - cutype: "INDIVIDUAL", - })) - ); + setQuery(""); + setSearch(""); + handleFilterChange("keywords", ""); + setSelectedContacts([]); }} > - + - - {query && ( - - { - setQuery(""); - setSearch(""); - handleFilterChange("keywords", ""); - }} - > - - - )} - + e.preventDefault()} + onClick={() => { + setAnchorEl(containerRef.current); + handleFilterChange("keywords", query); + handleFilterChange( + "organizers", + selectedContacts.map((a: User) => ({ + cn: a.displayName, + cal_address: a.email || "", + partstat: "NEEDS-ACTION", + rsvp: "FALSE", + role: "REQ-PARTICIPANT", + cutype: "INDIVIDUAL", + })) + ); + }} + > + + + ), }} /> diff --git a/src/locales/en.json b/src/locales/en.json index cab57d2..491ceb9 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -39,6 +39,7 @@ }, "common": { "cancel": "Cancel", + "clear": "Clear", "ok": "Ok", "link_copied": "Link copied!", "import_file": "File", @@ -57,7 +58,8 @@ "filter": { "allCalendar": "All calendars", "myCalendar": "My calendars", - "sharedCalendars": "Shared calendars" + "sharedCalendars": "Shared calendars", + "filters": "Filters" }, "keywords": "Keywords*", "keywordsPlaceholder": "Enter keywords", diff --git a/src/locales/fr.json b/src/locales/fr.json index e531cc3..aa1f4d8 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -39,6 +39,7 @@ }, "common": { "cancel": "Annuler", + "clear": "Effacer", "ok": "OK", "link_copied": "Lien copié !", "import_file": "Fichier", @@ -57,7 +58,8 @@ "filter": { "allCalendar": "Tous les calendriers", "myCalendar": "Mes calendriers", - "sharedCalendars": "Calendriers partagés" + "sharedCalendars": "Calendriers partagés", + "filters": "Filtres" }, "keywords": "Mots-clés*", "keywordsPlaceholder": "Saisissez des mots-clés", diff --git a/src/locales/ru.json b/src/locales/ru.json index 6069a44..f1274e6 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -39,6 +39,7 @@ }, "common": { "cancel": "Отмена", + "clear": "Очистить", "ok": "Ок", "link_copied": "Ссылка скопирована", "import_file": "Файл", @@ -57,7 +58,8 @@ "filter": { "allCalendar": "Все календари", "myCalendar": "Мои календари", - "sharedCalendars": "Общие календари" + "sharedCalendars": "Общие календари", + "filters": "Фильтры" }, "keywords": "Ключевые слова*", "keywordsPlaceholder": "Введите ключевые слова", diff --git a/src/locales/vi.json b/src/locales/vi.json index a6a4c9c..2cb9a9d 100644 --- a/src/locales/vi.json +++ b/src/locales/vi.json @@ -39,6 +39,7 @@ }, "common": { "cancel": "Hủy", + "clear": "Xóa", "ok": "OK", "link_copied": "Đã sao chép liên kết!", "import_file": "Tệp", @@ -57,7 +58,8 @@ "filter": { "allCalendar": "Tất cả lịch", "myCalendar": "Lịch của tôi", - "sharedCalendars": "Lịch được chia sẻ" + "sharedCalendars": "Lịch được chia sẻ", + "filters": "Bộ lọc" }, "keywords": "Từ khóa*", "keywordsPlaceholder": "Nhập từ khóa",