Skip to content

Commit 66e734b

Browse files
committed
fix: hide empty option on multi-select as well
1 parent e2fbe90 commit 66e734b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/pluggableWidgets/datagrid-dropdown-filter-web/src/DatagridDropdownFilter.editorConfig.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@ export function getProperties(values: DatagridDropdownFilterPreviewProps, defaul
1919
hidePropertiesIn(defaultProperties, values, ["attr", "attrChoice", "filterOptions", "auto"]);
2020
}
2121

22-
if (values.filterable) {
23-
hidePropertyIn(defaultProperties, values, "clearable");
22+
if (values.filterable || values.multiSelect) {
23+
// empty option is not shown when any of those are enabled
2424
hidePropertyIn(defaultProperties, values, "emptyOptionCaption");
25-
} else {
26-
hidePropertyIn(defaultProperties, values, "filterInputPlaceholderCaption");
2725
}
2826

29-
if (!values.filterable) {
27+
if (values.filterable) {
28+
// when it is filterable, we always imply clearable as true, so we hide the property
29+
hidePropertyIn(defaultProperties, values, "clearable");
30+
} else {
31+
// when it is not filterable, we don't need the attribute to search on
3032
hidePropertyIn(defaultProperties, values, "refSearchAttr");
33+
// when it is not filterable, we hide the caption for input as input is never shown
34+
hidePropertyIn(defaultProperties, values, "filterInputPlaceholderCaption");
3135
}
3236

3337
if (values.refCaptionSource === "attr") {

0 commit comments

Comments
 (0)