[#419] removed duplicate adornment and ugly padding (#428)

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
Camille Moussu
2026-01-05 11:48:05 +01:00
committed by GitHub
parent 6839353f34
commit e59d878e6c
6 changed files with 45 additions and 36 deletions
@@ -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)
+30 -32
View File
@@ -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>
),
}}
/>