Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use document scroll instead of the visual viewport #7298

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

web-padawan
Copy link
Member

@web-padawan web-padawan commented Apr 3, 2024

Description

Follow-up to #7279

After merging the above PR, I discovered that for some reason, scroll event isn't fired on window.visualViewport on desktop browsers, so e.g. vaadin-combo-box overlay doesn't reposition on scroll with that change:

scroll-bug.mp4

Restored listening to scroll event on the document in addition to window.visualViewport (used by iOS).

Type of change

  • Bugfix

@web-padawan web-padawan marked this pull request as draft April 3, 2024 13:37
@web-padawan web-padawan marked this pull request as ready for review April 3, 2024 13:46
Copy link

sonarcloud bot commented Apr 3, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

this.__positionTargetAncestorRootNodes = getAncestorRootNodes(this.positionTarget).filter(
(node) => node !== document,
);
this.__positionTargetAncestorRootNodes = getAncestorRootNodes(this.positionTarget);
Copy link
Member Author

Choose a reason for hiding this comment

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

This restores listening to scroll events on the document for desktop browsers.

@web-padawan web-padawan merged commit f3a9e07 into main Apr 4, 2024
9 checks passed
@web-padawan web-padawan deleted the fix/document-scroll branch April 4, 2024 06:44
web-padawan added a commit that referenced this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants