Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

fix: labels empty state for drop down (#6216)

Vamsi Krishnaddd4b51b4ee7
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 39c7618093..0c61feee8c 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<IIssueLabelSelect> = observer((props) =>
) : canCreateLabel ? (
<p
onClick={() => {
+ 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 <span className="text-custom-text-100">&quot;{query}&quot;</span> to labels
+ {query.length ? (
+ <>
+ + Add <span className="text-custom-text-100">&quot;{query}&quot;</span> to labels
+ </>
+ ) : (
+ "Type to add a new label"
+ )}
</p>
) : (
<p className="text-left text-custom-text-200 ">No matching results.</p>
diff --git a/web/core/components/issues/issue-layouts/properties/labels.tsx b/web/core/components/issues/issue-layouts/properties/labels.tsx
index 56f9b651be..697bf376b7 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<IIssuePropertyLabels> = observer((pro
) : canCreateLabel ? (
<p
onClick={() => {
+ 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 <span className="text-custom-text-100">&quot;{query}&quot;</span> to labels
+ {query.length ? (
+ <>
+ + Add <span className="text-custom-text-100">&quot;{query}&quot;</span> to labels
+ </>
+ ) : (
+ "Type to add a new label"
+ )}
</p>
) : (
<p className="text-left text-custom-text-200 ">No matching results.</p>