From ddd4b51b4ee7d081f06b5a1abdba25467065e897 Mon Sep 17 00:00:00 2001 From: Vamsi Krishna <46787868+mathalav55@users.noreply.github.com> Date: Tue, 17 Dec 2024 19:14:10 +0530 Subject: [PATCH] fix: labels empty state for drop down (#6216) --- .../issues/issue-detail/label/select/label-select.tsx | 11 +++++++++-- .../issues/issue-layouts/properties/labels.tsx | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/web/core/components/issues/issue-detail/label/select/label-select.tsx b/web/core/components/issues/issue-detail/label/select/label-select.tsx index 39c76180937..0c61feee8ca 100644 --- a/web/core/components/issues/issue-detail/label/select/label-select.tsx +++ b/web/core/components/issues/issue-detail/label/select/label-select.tsx @@ -185,11 +185,18 @@ export const IssueLabelSelect: React.FC = observer((props) => ) : canCreateLabel ? (

{ + if(!query.length) return handleAddLabel(query); }} - className="text-left text-custom-text-200 cursor-pointer" + className={`text-left text-custom-text-200 ${query.length ? "cursor-pointer" : "cursor-default"}`} > - + Add "{query}" to labels + {query.length ? ( + <> + + Add "{query}" to labels + + ) : ( + "Type to add a new label" + )}

) : (

No matching results.

diff --git a/web/core/components/issues/issue-layouts/properties/labels.tsx b/web/core/components/issues/issue-layouts/properties/labels.tsx index 56f9b651bef..697bf376b71 100644 --- a/web/core/components/issues/issue-layouts/properties/labels.tsx +++ b/web/core/components/issues/issue-layouts/properties/labels.tsx @@ -341,11 +341,18 @@ export const IssuePropertyLabels: React.FC = observer((pro ) : canCreateLabel ? (

{ + if (!query.length) return; handleAddLabel(query); }} - className="text-left text-custom-text-200 cursor-pointer" + className={`text-left text-custom-text-200 ${query.length ? "cursor-pointer" : "cursor-default"}`} > - + Add "{query}" to labels + {query.length ? ( + <> + + Add "{query}" to labels + + ) : ( + "Type to add a new label" + )}

) : (

No matching results.