Skip to content

GAUD-10291 - Fix issue where focusing the divider causes a page scroll#7221

Merged
svanherk merged 6 commits into
mainfrom
GAUD-10291-Fix-tabbing-to-divider-causes-page-scroll
Jul 15, 2026
Merged

GAUD-10291 - Fix issue where focusing the divider causes a page scroll#7221
svanherk merged 6 commits into
mainfrom
GAUD-10291-Fix-tabbing-to-divider-causes-page-scroll

Conversation

@svanherk

@svanherk svanherk commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

You can check the current demo page and see that when you tab to the divider, the page scrolls the header away. Fixing this by adding the very beginnings of the collapse button, and having the focus go to that (which is always in the viewport, so no scroll happens).

While fixing this, I broke the opposite (causing it to scroll back to the top if already scrolled), so also added a few vdiffs for that case. Confirmed they were broken when added, and fixed by the finally commit.

vdiff report here. You'll see that the existing tests no longer scroll, and the new ones stayed scrolled.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://live.d2l.dev/prs/BrightspaceUI/core/pr-7221/

Note

The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

}
.horizontal-fields {
display: flex;
flex-wrap: wrap;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unrelated, but was driving me crazy

it('calculates aria values correctly', async() => {
const elem = await fixture(html`<d2l-page-divider-internal label="Resize" min-size="100" max-size="200" current-size="150"></d2l-page-divider-internal>`);
const slider = elem.shadowRoot.querySelector('.divider');
const slider = getSlider(elem);

@svanherk svanherk Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made this function so the update in this PR would be cleaner, and then forgot to use it 🤦‍♀️

.slider {
outline: none;
position: absolute;
top: 55px;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will be (or will wrap) the collapse button, but just adding the minimum pieces right now to get the defect fixed and the vdiffs in place to protect from regressions.

@svanherk
svanherk marked this pull request as ready for review July 14, 2026 23:14
@svanherk
svanherk requested a review from a team as a code owner July 14, 2026 23:14
Comment thread components/page/page-divider-internal.js Outdated
github-actions Bot and others added 2 commits July 15, 2026 14:03
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@svanherk
svanherk merged commit fa04c8c into main Jul 15, 2026
11 checks passed
@svanherk
svanherk deleted the GAUD-10291-Fix-tabbing-to-divider-causes-page-scroll branch July 15, 2026 18:21
@d2l-github-release-tokens

Copy link
Copy Markdown

🎉 This PR is included in version 3.271.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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