Skip to content

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

Merged
supervons merged 1 commit intosupervons:masterfrom
congshengwu:webview-style
Jun 10, 2022
Merged

[feature] add props "webViewStyle", support setting the style of WebView component.#56
supervons merged 1 commit intosupervons:masterfrom
congshengwu:webview-style

Conversation

@congshengwu
Copy link
Copy Markdown
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
Copy Markdown
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