diff --git a/crates/typst-layout/src/grid/layouter.rs b/crates/typst-layout/src/grid/layouter.rs index 9f714ac86..d4682a9da 100644 --- a/crates/typst-layout/src/grid/layouter.rs +++ b/crates/typst-layout/src/grid/layouter.rs @@ -1747,11 +1747,6 @@ impl<'a> GridLayouter<'a> { ); if !last { - self.current.repeated_header_rows = 0; - self.current.last_repeated_header_end = 0; - self.current.repeating_header_height = Abs::zero(); - self.current.repeating_header_heights.clear(); - let disambiguator = self.finished.len(); if let Some(footer) = self.grid.footer.as_ref().and_then(Repeatable::as_repeated) @@ -1795,6 +1790,11 @@ impl<'a> GridLayouter<'a> { self.current.could_progress_at_top = self.regions.may_progress(); + self.current.repeated_header_rows = 0; + self.current.last_repeated_header_end = 0; + self.current.repeating_header_height = Abs::zero(); + self.current.repeating_header_heights.clear(); + if !self.grid.headers.is_empty() { self.finished_header_rows.push(header_row_info); }