Skip to content

Commit 363a10e

Browse files
committed
fix: showinput placeholder on "label" multiselctor
1 parent 9f7c345 commit 363a10e

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

packages/pluggableWidgets/combobox-web/src/components/MultiSelection/MultiSelection.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,9 @@ export function MultiSelection({ selector, tabIndex, ...options }: SelectionBase
9090
{ suppressRefError: true }
9191
)}
9292
/>
93-
{selector.selectedItemsStyle === "text" && (
94-
<InputPlaceholder isEmpty={selectedItems.length <= 0}>
95-
{getSelectedCaptionsPlaceholder(selector, selectedItems)}
96-
</InputPlaceholder>
97-
)}
93+
<InputPlaceholder isEmpty={selectedItems.length <= 0}>
94+
{getSelectedCaptionsPlaceholder(selector, selectedItems)}
95+
</InputPlaceholder>
9896
</div>
9997

10098
{!selector.readOnly &&

packages/pluggableWidgets/combobox-web/src/helpers/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { ComboboxPreviewProps } from "typings/ComboboxProps";
22
import { MultiSelector } from "./types";
33

44
export function getSelectedCaptionsPlaceholder(selector: MultiSelector, selectedItems: string[]): string {
5-
if (selector.selectedItemsStyle !== "text") {
6-
return "";
7-
}
85
if (selectedItems.length === 0) {
96
return selector.caption.emptyCaption;
107
}
118

9+
if (selector.selectedItemsStyle !== "text") {
10+
return "";
11+
}
1212
return selectedItems.map(v => selector.caption.get(v)).join(", ");
1313
}
1414

0 commit comments

Comments
 (0)