Skip to content

Commit fa4af3c

Browse files
fix: labels empty state for drop down (#6216)
1 parent c17f43f commit fa4af3c

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

web/core/components/issues/issue-detail/label/select/label-select.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,18 @@ export const IssueLabelSelect: React.FC<IIssueLabelSelect> = observer((props) =>
185185
) : canCreateLabel ? (
186186
<p
187187
onClick={() => {
188+
if(!query.length) return
188189
handleAddLabel(query);
189190
}}
190-
className="text-left text-custom-text-200 cursor-pointer"
191+
className={`text-left text-custom-text-200 ${query.length ? "cursor-pointer" : "cursor-default"}`}
191192
>
192-
+ Add <span className="text-custom-text-100">&quot;{query}&quot;</span> to labels
193+
{query.length ? (
194+
<>
195+
+ Add <span className="text-custom-text-100">&quot;{query}&quot;</span> to labels
196+
</>
197+
) : (
198+
"Type to add a new label"
199+
)}
193200
</p>
194201
) : (
195202
<p className="text-left text-custom-text-200 ">No matching results.</p>

web/core/components/issues/issue-layouts/properties/labels.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,18 @@ export const IssuePropertyLabels: React.FC<IIssuePropertyLabels> = observer((pro
341341
) : canCreateLabel ? (
342342
<p
343343
onClick={() => {
344+
if (!query.length) return;
344345
handleAddLabel(query);
345346
}}
346-
className="text-left text-custom-text-200 cursor-pointer"
347+
className={`text-left text-custom-text-200 ${query.length ? "cursor-pointer" : "cursor-default"}`}
347348
>
348-
+ Add <span className="text-custom-text-100">&quot;{query}&quot;</span> to labels
349+
{query.length ? (
350+
<>
351+
+ Add <span className="text-custom-text-100">&quot;{query}&quot;</span> to labels
352+
</>
353+
) : (
354+
"Type to add a new label"
355+
)}
349356
</p>
350357
) : (
351358
<p className="text-left text-custom-text-200 ">No matching results.</p>

0 commit comments

Comments
 (0)