This is an automated email from the ASF dual-hosted git repository.
enzomartellucci pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new c59d0a73d47 fix: Prevent table rows from overlapping pagination in
table view (#37174)
c59d0a73d47 is described below
commit c59d0a73d474a32ab797e8a9e3ee1f303a134178
Author: Enzo Martellucci <[email protected]>
AuthorDate: Tue Feb 10 16:01:39 2026 +0100
fix: Prevent table rows from overlapping pagination in table view (#37174)
Co-authored-by: Diego Pucci <[email protected]>
---
.../Chart/DrillBy/useResultsTableView.test.ts | 48 ++++++++++++++++++++++
.../Chart/DrillBy/useResultsTableView.tsx | 5 ++-
.../components/SingleQueryResultPane.tsx | 5 ++-
.../src/explore/components/DataTablesPane/types.ts | 1 +
4 files changed, 55 insertions(+), 4 deletions(-)
diff --git
a/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.test.ts
b/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.test.ts
index 3eed3696f52..59a5505a76e 100644
--- a/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.test.ts
+++ b/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.test.ts
@@ -27,6 +27,24 @@ import {
} from 'spec/helpers/testing-library';
import { useResultsTableView } from './useResultsTableView';
+const capturedProps: any[] = [];
+
+jest.mock(
+ 'src/explore/components/DataTablesPane/components/SingleQueryResultPane',
+ () => {
+ const actual = jest.requireActual(
+ 'src/explore/components/DataTablesPane/components/SingleQueryResultPane',
+ );
+ return {
+ ...actual,
+ SingleQueryResultPane: (props: any) => {
+ capturedProps.push(props);
+ return actual.SingleQueryResultPane(props);
+ },
+ };
+ },
+);
+
const MOCK_CHART_DATA_RESULT = [
{
colnames: ['name', 'sum__num'],
@@ -111,3 +129,33 @@ test('Displays results for 2 queries', async () => {
within(getActiveTabElement()).getAllByTestId('table-row'),
).toHaveLength(2);
});
+
+test('passes isPaginationSticky={false} to SingleQueryResultPane for single
query', () => {
+ capturedProps.length = 0;
+ const { result } = renderHook(() =>
+ useResultsTableView(MOCK_CHART_DATA_RESULT.slice(0, 1), '1__table', true),
+ );
+ render(result.current, { useRedux: true });
+
+ expect(capturedProps.length).toBeGreaterThan(0);
+ capturedProps.forEach(props => {
+ expect(props).toMatchObject({
+ isPaginationSticky: false,
+ });
+ });
+});
+
+test('passes isPaginationSticky={false} to SingleQueryResultPane for multiple
queries', () => {
+ capturedProps.length = 0;
+ const { result } = renderHook(() =>
+ useResultsTableView(MOCK_CHART_DATA_RESULT, '1__table', true),
+ );
+ render(result.current, { useRedux: true });
+
+ expect(capturedProps.length).toBeGreaterThanOrEqual(2);
+ capturedProps.forEach(props => {
+ expect(props).toMatchObject({
+ isPaginationSticky: false,
+ });
+ });
+});
diff --git
a/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx
b/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx
index da9d99ef91a..ce27989a003 100644
--- a/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx
+++ b/superset-frontend/src/components/Chart/DrillBy/useResultsTableView.tsx
@@ -16,9 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { t } from '@apache-superset/core';
import { isDefined, QueryData } from '@superset-ui/core';
-import { css, styled } from '@apache-superset/core/ui';
+import { css, styled, t } from '@apache-superset/core/ui';
import { SingleQueryResultPane } from
'src/explore/components/DataTablesPane/components/SingleQueryResultPane';
import Tabs from '@superset-ui/core/components/Tabs';
@@ -52,6 +51,7 @@ export const useResultsTableView = (
datasourceId={datasourceId}
isVisible
canDownload={canDownload}
+ isPaginationSticky={false}
/>
</PaginationContainer>
);
@@ -73,6 +73,7 @@ export const useResultsTableView = (
datasourceId={datasourceId}
isVisible
canDownload={canDownload}
+ isPaginationSticky={false}
/>
</PaginationContainer>
),
diff --git
a/superset-frontend/src/explore/components/DataTablesPane/components/SingleQueryResultPane.tsx
b/superset-frontend/src/explore/components/DataTablesPane/components/SingleQueryResultPane.tsx
index 562f5cc9eb7..6e096182234 100644
---
a/superset-frontend/src/explore/components/DataTablesPane/components/SingleQueryResultPane.tsx
+++
b/superset-frontend/src/explore/components/DataTablesPane/components/SingleQueryResultPane.tsx
@@ -17,7 +17,7 @@
* under the License.
*/
import { useState, useCallback } from 'react';
-import { t } from '@apache-superset/core';
+import { t } from '@apache-superset/core/ui';
import {
TableView,
TableSize,
@@ -40,6 +40,7 @@ export const SingleQueryResultPane = ({
isVisible,
canDownload,
columnDisplayNames,
+ isPaginationSticky = true,
}: SingleQueryResultPaneProp) => {
const [filterText, setFilterText] = useState('');
@@ -82,7 +83,7 @@ export const SingleQueryResultPane = ({
noDataText={t('No results')}
emptyWrapperType={EmptyWrapperType.Small}
className="table-condensed"
- isPaginationSticky
+ isPaginationSticky={isPaginationSticky}
showRowCount={false}
small
/>
diff --git a/superset-frontend/src/explore/components/DataTablesPane/types.ts
b/superset-frontend/src/explore/components/DataTablesPane/types.ts
index d5b6891ec99..90ba2b98cb0 100644
--- a/superset-frontend/src/explore/components/DataTablesPane/types.ts
+++ b/superset-frontend/src/explore/components/DataTablesPane/types.ts
@@ -92,4 +92,5 @@ export interface SingleQueryResultPaneProp extends
QueryResultInterface {
canDownload: boolean;
// Optional map of column/metric name -> verbose label
columnDisplayNames?: Record<string, string>;
+ isPaginationSticky?: boolean;
}