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

[feature] add props "webViewStyle", support setting the style of WebView component. #56

Merged
merged 1 commit into from
Jun 10, 2022
Merged

Conversation

congshengwu
Copy link
Contributor

@congshengwu congshengwu commented Jun 6, 2022

Summary

It's a little change of this PR. Add a new props webViewStyle for RNEChartsPro to support customizing WebView style. Similar to the props webViewSettings. If I set style via webViewSettings which will cover the default style from source code, I don't think it's a good choice.

I meet a crash issue which is most likely from react-native-webview, and setting opacity: 0.99 of its style will resolve the crash issue. That's why I need this PR to change the style of WebView inside the RNEChartsPro.

Besides, I think maybe users will have other needs to set the style of WebView in the future.

Test plan

Pass style like opacity: 0.2 in webViewStyle

<RNEChartsPro
  width="100%"
  height={300}
  webViewStyle={{ opacity: 0.2 }}
  option={{
    xAxis: {
      type: 'category',
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        data: [150, 230, 224, 218, 135, 147, 260],
        type: 'line'
      }
    ]
  }}
/>

Compatibility

Android and iOS.

@supervons
Copy link
Owner

Thanks for your PR, test pass!

I think it's a reasonable scenario.

The next version will be released

@supervons supervons merged commit 35f0963 into supervons:master Jun 10, 2022
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.

WebView rerender crashes on Android API 28+
2 participants