diff --git a/packages/pluggableWidgets/datagrid-web/CHANGELOG.md b/packages/pluggableWidgets/datagrid-web/CHANGELOG.md index fa3c5989f1..fbe69d84b6 100644 --- a/packages/pluggableWidgets/datagrid-web/CHANGELOG.md +++ b/packages/pluggableWidgets/datagrid-web/CHANGELOG.md @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed +- We fixed an issue where the footer would take up unnecessary spacing when no content was rendered inside. + +### Added + - We added missing Dutch translations for Datagrid 2. ### Changed diff --git a/packages/pluggableWidgets/datagrid-web/src/components/WidgetFooter.tsx b/packages/pluggableWidgets/datagrid-web/src/components/WidgetFooter.tsx index 867b35f75b..ccaf2820ad 100644 --- a/packages/pluggableWidgets/datagrid-web/src/components/WidgetFooter.tsx +++ b/packages/pluggableWidgets/datagrid-web/src/components/WidgetFooter.tsx @@ -6,13 +6,23 @@ import { useSelectionCounterViewModel } from "../features/selection-counter/inje import { useCustomPagination, usePaginationConfig, usePaginationVM, useTexts } from "../model/hooks/injection-hooks"; import { Pagination } from "./Pagination"; -export const WidgetFooter = observer(function WidgetFooter(): ReactElement { +export const WidgetFooter = observer(function WidgetFooter(): ReactElement | null { const pgConfig = usePaginationConfig(); const paging = usePaginationVM(); const { loadMoreButtonCaption } = useTexts(); const selectionCounterVM = useSelectionCounterViewModel(); const customPagination = useCustomPagination(); + const showFooter = + selectionCounterVM.isBottomCounterVisible || + paging.paginationVisible || + paging.showVirtualScrollingWithRowCount || + paging.showLoadMore; + + if (!showFooter) { + return null; + } + return (