From 8b0a8160a1ca8281381ae25958fa92d660858a0f Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Wed, 17 Dec 2025 20:17:42 +0530 Subject: [PATCH] [WEB-5614] fix: sidebar and label dropdown #8364 --- .../label/select/label-select.tsx | 224 +++++++----------- .../issues/issue-detail/sidebar.tsx | 2 +- .../components/issues/peek-overview/view.tsx | 2 +- 3 files changed, 90 insertions(+), 138 deletions(-) diff --git a/apps/web/core/components/issues/issue-detail/label/select/label-select.tsx b/apps/web/core/components/issues/issue-detail/label/select/label-select.tsx index 723ad8ccfb..733cd33b5b 100644 --- a/apps/web/core/components/issues/issue-detail/label/select/label-select.tsx +++ b/apps/web/core/components/issues/issue-detail/label/select/label-select.tsx @@ -71,7 +71,7 @@ export const IssueLabelSelect = observer(function IssueLabelSelect(props: IIssue query === "" ? options : options?.filter((option) => option.query.toLowerCase().includes(query.toLowerCase())); const { styles, attributes } = usePopper(referenceElement, popperElement, { - placement: "bottom-end", + placement: "bottom-start", modifiers: [ { name: "preventOverflow", @@ -114,149 +114,101 @@ export const IssueLabelSelect = observer(function IssueLabelSelect(props: IIssue if (!issueId || !values) return <>; return ( - onSelect(value)} - multiple - > - - - - -
-
-
- - setQuery(e.target.value)} - placeholder={t("common.search.label")} - displayValue={(assigned: any) => assigned?.name} - onKeyDown={searchInputKeyDown} - tabIndex={baseTabIndex} - /> + <> + onSelect(value)} + multiple + > + + + + + +
+
+
+ + setQuery(e.target.value)} + placeholder={t("common.search.label")} + displayValue={(assigned: any) => assigned?.name} + onKeyDown={searchInputKeyDown} + tabIndex={baseTabIndex} + /> +
-
-
- {isLoading ? ( -

{t("common.loading")}

- ) : filteredOptions.length > 0 ? ( - filteredOptions.map((option) => ( +
+ {isLoading ? ( +

{t("common.loading")}

+ ) : filteredOptions.length > 0 ? ( + filteredOptions.map((option) => ( + + `flex cursor-pointer select-none items-center justify-between gap-2 truncate rounded-sm px-1 py-1.5 hover:bg-layer-1 ${ + selected ? "text-primary" : "text-secondary" + }` + } + > + {({ selected }) => ( + <> + {option.content} + {selected && ( +
+ +
+ )} + + )} +
+ )) + ) : submitting ? ( + + ) : canCreateLabel ? ( - `flex cursor-pointer select-none items-center justify-between gap-2 truncate rounded-sm px-1 py-1.5 hover:bg-layer-1 ${ - selected ? "text-primary" : "text-secondary" - }` - } + value={query} + onClick={(e) => { + e.preventDefault(); + e.stopPropagation(); + if (!query.length) return; + handleAddLabel(query); + }} + className={`text-left text-secondary ${query.length ? "cursor-pointer" : "cursor-default"}`} > - {({ selected }) => ( + {query.length ? ( <> - {option.content} - {selected && ( -
- -
- )} + {/* TODO: Translate here */}+ Add "{query}" to + labels + ) : ( + t("label.create.type") )}
- )) - ) : submitting ? ( - - ) : canCreateLabel ? ( - { - e.preventDefault(); - e.stopPropagation(); - if (!query.length) return; - handleAddLabel(query); - }} - className={`text-left text-secondary ${query.length ? "cursor-pointer" : "cursor-default"}`} - > - {query.length ? ( - <> - {/* TODO: Translate here */}+ Add "{query}" to - labels - - ) : ( - t("label.create.type") - )} - - ) : ( -

{t("common.search.no_matching_results")}

- )} -
-
-
- {isLoading ? ( -

{t("common.loading")}

- ) : filteredOptions.length > 0 ? ( - filteredOptions.map((option) => ( - - `flex cursor-pointer select-none items-center justify-between gap-2 truncate rounded-sm px-1 py-1.5 hover:bg-layer-1 ${ - selected ? "text-primary" : "text-secondary" - }` - } - > - {({ selected }) => ( - <> - {option.content} - {selected && ( -
- -
- )} - - )} -
- )) - ) : submitting ? ( - - ) : canCreateLabel ? ( - { - e.preventDefault(); - e.stopPropagation(); - if (!query.length) return; - handleAddLabel(query); - }} - className={`text-left text-secondary ${query.length ? "cursor-pointer" : "cursor-default"}`} - > - {query.length ? ( - <> - {/* TODO: Translate here */}+ Add "{query}" to labels - ) : ( - t("label.create.type") +

{t("common.search.no_matching_results")}

)} -
- ) : ( -

{t("common.search.no_matching_results")}

- )} -
-
-
+
+
+ + + ); }); diff --git a/apps/web/core/components/issues/issue-detail/sidebar.tsx b/apps/web/core/components/issues/issue-detail/sidebar.tsx index 4f72673165..d64665467b 100644 --- a/apps/web/core/components/issues/issue-detail/sidebar.tsx +++ b/apps/web/core/components/issues/issue-detail/sidebar.tsx @@ -81,7 +81,7 @@ export const IssueDetailsSidebar = observer(function IssueDetailsSidebar(props:
{t("common.properties")}
-
+
{["side-peek", "modal"].includes(peekMode) ? ( -
+