Skip to content

Commit 389f284

Browse files
committed
fix(data-widgets): fix header not showing when selection is multi
1 parent f624cd1 commit 389f284

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/pluggableWidgets/gallery-web/src/Gallery.editorConfig.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function getProperties(
2626
hidePropertyIn(defaultProperties, values, "emptyPlaceholder");
2727
}
2828

29-
if (values.filterList?.length === 0 && values.sortList?.length === 0 && values.itemSelection !== "Multi") {
29+
if (!showHeader(values)) {
3030
hidePropertyIn(defaultProperties, values, "filtersPlaceholder");
3131
}
3232

@@ -187,15 +187,14 @@ export function getPreview(values: GalleryPreviewProps, isDarkMode: boolean): St
187187

188188
return {
189189
type: "Container",
190-
children: [
191-
titleHeader,
192-
...(values.filterList.length > 0 || values.sortList.length > 0 ? [filters] : []),
193-
content,
194-
...footer
195-
]
190+
children: [titleHeader, ...(showHeader(values) ? [filters] : []), content, ...footer]
196191
};
197192
}
198193

199194
function getSingularPlural(word: string, elements: number): string {
200195
return elements > 1 ? word + "s" : word;
201196
}
197+
198+
function showHeader(values: GalleryPreviewProps): boolean {
199+
return values.filterList?.length > 0 || values.sortList?.length > 0 || values.itemSelection === "Multi";
200+
}

0 commit comments

Comments
 (0)