Skip to content
Snippets Groups Projects
Unverified Commit 1ed4f742 authored by github-automation-metabase's avatar github-automation-metabase Committed by GitHub
Browse files

fix: calculate row for object details correctly (#48673) (#48696)

parent 42e111b6
No related branches found
No related tags found
No related merge requests found
......@@ -184,6 +184,16 @@ describe("scenarios > question > object details", { tags: "@slow" }, () => {
assertOrderDetailView({ id: FIRST_ORDER_ID });
});
it("calculates a row after scrolling correctly (metabase#48323)", () => {
openOrdersTable();
cy.get(".ReactVirtualized__Grid").eq(1).scrollTo(0, 15000);
cy.icon("expand").first().click();
cy.findByRole("dialog")
.should("contain", "418")
.and("contain", "58")
.and("contain", "February 14, 2026, 10:12 AM");
});
it("handles browsing records by FKs (metabase#21756)", () => {
openOrdersTable();
......
......@@ -409,9 +409,9 @@ class TableInteractive extends Component {
};
recomputeGridSize = () => {
if (this.header && this.grid) {
if (this.header && this.gridRef.current) {
this.header.recomputeGridSize();
this.grid.recomputeGridSize();
this.gridRef.current.recomputeGridSize();
}
};
......@@ -1043,7 +1043,7 @@ class TableInteractive extends Component {
return;
}
const scrollOffset = this.gridRef.current?.scrollTop || 0;
const scrollOffset = this.gridRef.current?.props?.scrollTop || 0;
// infer row index from mouse position when we hover the gutter column
if (event?.currentTarget?.id === "gutter-column") {
......@@ -1262,7 +1262,7 @@ class TableInteractive extends Component {
/>
<Grid
id="main-data-grid"
ref={ref => (this.grid = ref)}
ref={this.gridRef}
style={{
top: headerHeight,
left: 0,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment