Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -312,44 +312,42 @@ export default function SearchBar() {
|
||||
</>
|
||||
),
|
||||
endAdornment: (
|
||||
<>
|
||||
{params.InputProps.endAdornment}
|
||||
<InputAdornment position="end">
|
||||
<InputAdornment position="end">
|
||||
{(query || selectedContacts.length > 0) && (
|
||||
<IconButton
|
||||
onMouseDown={(e) => 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([]);
|
||||
}}
|
||||
>
|
||||
<TuneIcon />
|
||||
<HighlightOffIcon />
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
{query && (
|
||||
<InputAdornment position="end">
|
||||
<IconButton
|
||||
onClick={() => {
|
||||
setQuery("");
|
||||
setSearch("");
|
||||
handleFilterChange("keywords", "");
|
||||
}}
|
||||
>
|
||||
<HighlightOffIcon />
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
)}
|
||||
</>
|
||||
<IconButton
|
||||
aria-label={t("search.filter.filters")}
|
||||
onMouseDown={(e) => 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",
|
||||
}))
|
||||
);
|
||||
}}
|
||||
>
|
||||
<TuneIcon />
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user