Skip to content

fix popover rendering issues on legacy Android WebView #8384

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

Closed
wants to merge 1 commit into from

Conversation

kristo
Copy link

@kristo kristo commented Jun 11, 2025

This update ensures proper positioning of all components that rely on the calculatePosition method in older browsers. Since document.documentElement.scrollTop always returns 0, even when the page is scrolled down, the solution introduces a fallback to document.body.scrollTop to accurately determine the scroll position.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

  • Use an affected version of Android WebView (tested on version 85).
  • Scroll down the page to create a noticeable scroll offset.
  • Open the popover component.
  • Observe the positioning of the popover—it should appear significantly lower than the expected position.

@snowystinger
Copy link
Member

Thanks for the PR and info. It looks like Android WebView 85 is more than 45 majors behind and is around 5 years old at this point. Do you know if there are any more modern versions that have the issue. Our stance is that we only support the latest 2 versions, though with how many releases chrome and ff do compared to safari, we could probably be convinced if the version was released in the last two years.

@kristo
Copy link
Author

kristo commented Jun 11, 2025

At the moment, I’m not aware of any more modern browsers exhibiting the issue. We do need to support some older devices that rely on a legacy version of WebView, so we had to introduce this patch anyway. The fix appears to be stable, and based on your .browserslistrc configuration, it looks like Chrome versions greater than 79 are officially supported

@snowystinger
Copy link
Member

Unfortunately the browserslist is stuck right now because if we update it, it breaks webpack 4, which is not a browser...

Given that we cannot test this and we cannot guard against regressions and there isn't a timeline for how long we would need to support this.

I suspect a lot of other things are broken in that version of Android WebView as well.

I'm going to close this as not doing. If there is an issue in a more recent version, roughly the last 2 years, then we will consider it. For we think the best course of action is to continue to use a patch.

Thanks for understanding.

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.

2 participants