Skip to content

Pagination: ignore layout measurements taken before the theme CSS is applied - #35486

Merged
EugeniyKiyashko merged 6 commits into
DevExpress:mainfrom
EugeniyKiyashko:fix/pager-compact-unstyled-5261
Oct 6, 2026
Merged

EugeniyKiyashko merged 6 commits into
DevExpress:mainfrom
EugeniyKiyashko:fix/pager-compact-unstyled-5261

Conversation

@EugeniyKiyashko

Copy link
Copy Markdown
Contributor

No description provided.

@EugeniyKiyashko
EugeniyKiyashko requested a review from a team as a code owner October 5, 2026 20:32
Copilot AI balanced review requested due to automatic review settings October 5, 2026 20:32
@EugeniyKiyashko EugeniyKiyashko self-assigned this Oct 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

An idle explicitly compact pagination retains its fallback width after theme CSS loads.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Prevents pagination adaptivity from using measurements captured before theme CSS loads.

Changes:

  • Detects whether themed pagination layout is applied.
  • Recalculates adaptivity and compact page-index width after updates.
  • Adds Jest and QUnit regression coverage.
File Description
pagination.tests.js Adds CSS-loading regression tests.
get_element_width.ts Adds block-layout detection.
resizable_container.tsx Defers measurements and observes theme readiness.
pages/​small.tsx Rechecks minimum width after prop changes.
resizable-container.test.ts Tests layout detection and adaptivity.
pages-small.test.ts Tests compact index-width recalculation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/devextreme/js/__internal/pagination/resizable_container.tsx Outdated
Copilot AI balanced review requested due to automatic review settings October 5, 2026 20:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread packages/devextreme/js/__internal/pagination/__tests__/pages-small.test.ts Outdated
Comment thread packages/devextreme/js/__internal/pagination/pages/small.tsx
Comment thread packages/devextreme/js/__internal/pagination/utils/get_element_width.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The readiness check misses info-only pagination, allowing an unstyled width to be cached permanently.

Review effort: Balanced
Findings: None

Resolved since last review (6)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Include infoTextRef when checking layout readiness

packages/​devextreme/​js/​__internal/​pagination/​resizable_container.tsx:42

isLayoutApplied overlooks the info element. With the supported combination pageSize: 0, showInfo: true, and no page-size selector, both checked refs are absent, so an unstyled .dx-info block is measured and cached as the full parent width. The first update then hides the info, and the theme-ready update cannot remeasure it because its ref is gone, leaving it hidden even at a wide width. Include infoTextRef in this readiness check (the themed .dx-info is inline-block) and cover this info-only configuration.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 08:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Info-only pagination can still cache an unstyled measurement and permanently hide its info text.

Review effort: Balanced
Findings: None

Previously missed (1)

In code that hasn't changed since last review

Medium severity Include infoTextRef in pager layout readiness checks

packages/​devextreme/​js/​__internal/​pagination/​resizable_container.tsx:42

When the pager contains only the info text (for example, showInfo: true with the “all” page size, where pageSize === 0 suppresses the page-index selector), both checked refs are absent, so this returns true even before CSS is applied. The unstyled .dx-info is then measured as a full-width block, infoTextVisible becomes false, and its cached width prevents the info text from returning after theme readiness. Include infoTextRef in this layout-readiness check so this valid info-only layout also ignores its unstyled measurement.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 10:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation addresses delayed theme styling with focused lifecycle handling and comprehensive regression coverage.

Review effort: Balanced
Findings: None

Copilot AI balanced review requested due to automatic review settings October 6, 2026 10:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation addresses delayed CSS measurements and provides focused regression coverage for each affected path.

Review effort: Balanced
Findings: None

Copilot AI balanced review requested due to automatic review settings October 6, 2026 10:27
@EugeniyKiyashko
EugeniyKiyashko force-pushed the fix/pager-compact-unstyled-5261 branch from acdf872 to 9b350ad Compare October 6, 2026 10:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The measurement guards, theme-ready updates, cleanup behavior, and relevant regressions are comprehensively covered.

Review effort: Balanced
Findings: None

@EugeniyKiyashko
EugeniyKiyashko merged commit a5f5e2a into DevExpress:main Oct 6, 2026
149 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants