Skip to content

fix: remember size of ignored scroll events - #145

Open
OEvgeny wants to merge 1 commit into
compulim:mainfrom
OEvgeny:fix-ignored-resize-after-scroll-animation
Open

OEvgeny wants to merge 1 commit into
compulim:mainfrom
OEvgeny:fix-ignored-resize-after-scroll-animation

Conversation

@OEvgeny

@OEvgeny OEvgeny commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Changelog

  • Fixed scrolling up being mistaken as a resize and scrolled back to the end, after the container is resized while scrolling to the end, by @OEvgeny in PR #145

Specific changes

  • When a "scroll" event is ignored because it was dispatched before the scroll animation ended, still remember the latest offsetHeight and scrollHeight
    • Otherwise, if the container is resized during the animation, the next scroll by the user is mistaken as a resize while sticky, and it scrolls back to the end
  • Added scroll-up-after-resize-while-scrolling test

Scroll events dispatched before the scroll animation ended may be handled after it ended (debounced), and are ignored without updating the remembered size. If the container was resized during the animation, the next scroll event (e.g. scrolling up by the user) is mistaken as a resize while sticky, and it scrolls back to the end.
@OEvgeny
OEvgeny force-pushed the fix-ignored-resize-after-scroll-animation branch from 32c3cd1 to 04db1e5 Compare October 16, 2026 20:32
OEvgeny pushed a commit to microsoft/BotFramework-WebChat that referenced this pull request Oct 16, 2026
- unknownAttachment.html: wait with @testduet/wait-for and expect.
- scrollToTop(): clarify why scrolling again is needed, add a TODO to remove the retry after compulim/react-scroll-to-bottom#145 is released.
OEvgeny added a commit to microsoft/BotFramework-WebChat that referenced this pull request Oct 16, 2026
* Move changelog entries merged after 4.19.2 to Unreleased

#5865 and #5872 were merged after v4.19.2 was published (2026-10-09T05:20Z), but their entries were filed under 4.19.2.

* Fix flaky scrollToTop and unknownAttachment tests

- pageObjects.scrollToTop(): react-scroll-to-bottom ignores scroll events right after its animation ends without updating the sizes it remembers. The next scroll is mistaken as a resize while sticky and it scrolls back to the bottom. Scroll again (up to 3 attempts), like a user would. Fixes scrollToEndButton.containerSize.html failing ~15-25% under load (40/40 after).
- unknownAttachment.html: the live region renders the activity 5-15 ms after the transcript, wait for the console.warn before asserting.

* Remove checkAccessibility overrides from tests

Replacing window.checkAccessibility disabled accessibility checks for whole tests. With the checker running:

- 11 tests had obsolete overrides (no violations in any variant), removed. part-grouping/keyboard, navigation and position never ran with a variant, the overrides were dead code.
- Known violations are now skipped explicitly with skipCheckAccessibility, scoped to the failing variants and snapshots, with a TODO:
  - part-grouping/status and index (copilot): part grouping remounts when its first activity changes, aria-activedescendant points to the removed group.
  - side-by-side: the deprecated Copilot custom variant puts non-articles in role="feed"; contrast in the View code dialog.
  - markdown/vnext/markdownStreaming: bot markdown "# Heading" renders a level-one heading (#4721).

* Address review: use waitFor, link react-scroll-to-bottom fix

- unknownAttachment.html: wait with @testduet/wait-for and expect.
- scrollToTop(): clarify why scrolling again is needed, add a TODO to remove the retry after compulim/react-scroll-to-bottom#145 is released.

---------

Co-authored-by: Eugene Olonov <eugeneolonov@microsoft.com>
OEvgeny added a commit to microsoft/BotFramework-WebChat that referenced this pull request Nov 4, 2026
* Fix flaky scrollToEndButton.withEventActivities test

The test scrolled up with a raw `scrollTop = 0` and a 1 s sleep. When the
"Connecting..." bar goes away (400 ms notification debounce) while the
initial scroll to the bottom is still animating, react-scroll-to-bottom
ignores that scroll event and keeps the old size. The test's scroll is then
taken as a resize while sticky and the transcript scrolls back to the
bottom, so the next message is read and the "New messages" button never
shows.

Use pageObjects.scrollToTop(), which waits for the scroll to settle and
scrolls again, as the other scrollToEndButton tests do
(compulim/react-scroll-to-bottom#145).

* Add the changelog fragment

---------

Co-authored-by: Eugene Olonov <eugeneolonov@microsoft.com>

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant