Skip to content

Overlay, DropDownBox: do not scroll the page when focusing - #36443

Open
Raushen wants to merge 13 commits into
DevExpress:mainfrom
Raushen:27_1_dropdownbox_focus-without-scroll
Open

Raushen wants to merge 13 commits into
DevExpress:mainfrom
Raushen:27_1_dropdownbox_focus-without-scroll

Conversation

@Raushen

@Raushen Raushen commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Raushen
Raushen requested a review from a team as a code owner November 19, 2026 13:35
Copilot AI balanced review requested due to automatic review settings November 19, 2026 13:35
@Raushen Raushen self-assigned this Nov 19, 2026
@Raushen Raushen added the 27_1 label Nov 19, 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.

🟡 Changes recommended

The focus assertion fails in Shadow DOM mode because it checks the fixture’s shadow root for a body-mounted overlay instead of using document.activeElement.

1 open issue
What changed in this PR

This PR prevents page scrolling when Overlay and DropDownBox move focus after opening.

Changes:

  • Uses native focus({ preventScroll: true }) for overlay content and the first tabbable DropDownBox element.
  • Adds regression tests checking that off-screen content receives focus without changing the page’s scroll position.
File Description
packages/​devextreme/​testing/​tests/​DevExpress.ui.widgets/​overlay.tests.js Tests overlay focus without page scrolling.
packages/​devextreme/​testing/​tests/​DevExpress.ui.widgets.editors/​dropDownBox.tests.js Tests popup content focus without page scrolling.
packages/​devextreme/​js/​__internal/​ui/​overlay/​overlay.ts Prevents scrolling when focusing overlay content.
packages/​devextreme/​js/​__internal/​ui/​drop_down_box.ts Prevents scrolling when focusing the first tabbable element.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 19, 2026 14:16

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.

🟢 Approval recommended

No active review issues were identified in the change to prevent scrolling when Overlay and DropDownBox receive focus.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 19, 2026 14:42

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.

🟡 Changes recommended

The focus helper can leave inputs horizontally offscreen or partially clipped because it only adjusts vertical scrolling and uses outer bounds rather than the container’s visible client viewport.

2 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 19, 2026 16:39

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.

🔵 Needs a closer look

Human assessment is needed because the scrolling calculations mix transformed and unscaled coordinates, potentially leaving focused inputs clipped in scaled containers.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 19, 2026 17:24

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.

🔵 Needs a closer look

Human assessment is needed because sequential scroll updates can cancel smooth vertical scrolling, leaving the focused input clipped when native focus scrolling is suppressed.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 19, 2026 18:22

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.

🔵 Needs a closer look

Human assessment is needed because smooth scrolling in nested containers can invalidate ancestor measurements and leave the focused input outside the popup viewport.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 19, 2026 18:59

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.

🟡 Changes recommended

Scroll offsets assume ancestors complete the requested scroll even when they clamp or ignore it, causing outer scrollers to leave inputs off-screen.

1 open issue

Review effort: Balanced

Comment on lines +110 to +111
shiftTop += top;
shiftLeft += left;
Copilot AI balanced review requested due to automatic review settings November 19, 2026 19:50

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.

🔵 Needs a closer look

Ancestors without a real scrollport still contribute scroll deltas, causing outer containers to miscalculate scrolling and leave focused inputs clipped.

1 open issue

Review effort: Balanced

This branch has not been deployed

No deployments
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.

2 participants