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 CSS rendering bug when using startInLoadingState #612

Conversation

pmusaraj
Copy link
Contributor

I am using react-native-weview on an app, and it works very well. But, when I introduced a custom loading screen, I noticed a very odd bug in the application of CSS to the webpage inside the webview. This is best explained via screenshots:

Before using startInLoadingState={true}
image

After using startInLoadingState={true}
image

Notice that the bar at the bottom of the webview has a blur effect in the first screenshot, but no blur effect in the second screenshot. The css applied to the underlying site has not changed. To reproduce, load a webpage in the webview with an element that has -webkit-backdrop-filter: blur(20px); and something colorful behind it (so you can see the blur effect). The URL of the page in the screenshot is https://review.discourse.org.

The source of the issue is that when using startInLoadingState={true}, the webview initially is hidden (width: 0; flex: 0) and then shown, and this trips up the renderer. Switching to positioning the loading/error views absolutely fixes the issue.

The styles for the error view and loading view are identical, so this PR merges them into one loadingOrErrorView style.

@Titozzz Titozzz merged commit d429e82 into react-native-webview:master Jun 2, 2019
react-native-community-bot pushed a commit that referenced this pull request Jun 2, 2019
# [6.2.0](v6.1.1...v6.2.0) (2019-06-02)

### Features

* **loading:** Changed loading/error rendering ([#612](#612)) ([d429e82](d429e82))
@react-native-community-bot
Copy link
Collaborator

🎉 This PR is included in version 6.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

phuongwd pushed a commit to phuongwd/react-native-webview that referenced this pull request Apr 29, 2020
phuongwd pushed a commit to phuongwd/react-native-webview that referenced this pull request Apr 29, 2020
noproblem23 added a commit to noproblem23/react-native-webview that referenced this pull request Apr 18, 2023
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.

None yet

4 participants