Code Monkey home page Code Monkey logo

Comments (5)

haorh avatar haorh commented on June 9, 2024

It turns out from 0.57 onward, WebView behaviour has changed.
The issue isnt about multiple highchart, its related to highchart affecting previous sibling elements.

In react-native-highcharts.js, add overflow: 'hidden' at parent of WebView in render()

return (
            <View style={[this.props.style, {overflow: 'hidden'}]}>
                <WebView
                    onLayout={this.reRenderWebView}
                    style={styles.full}
                    source={{html: concatHTML, baseUrl: 'web/'}}
                    javaScriptEnabled={true}
                    domStorageEnabled={true}
                    scalesPageToFit={false}
                    scrollEnabled={false}
                    mixedContentMode='always'
                    automaticallyAdjustContentInsets={true}
                    {...this.props}
                />
            </View>
        );

Solution
https://stackoverflow.com/questions/52872045/rendering-webview-on-android-device-overlaps-previous-siblings-from-same-parent?answertab=votes#tab-top

react-native-webview/react-native-webview#101 (comment)

from react-native-highcharts.

haorh avatar haorh commented on June 9, 2024

Or without touching the github file,

<ChartView style={{overflow: 'hidden'}} />

from react-native-highcharts.

WillKre avatar WillKre commented on June 9, 2024

@haorh been battling this bug for ages, thanks for the working solution 🔥

from react-native-highcharts.

haorh avatar haorh commented on June 9, 2024

Extra note, for RN59, RN will throw "WebView has been extracted from react-native core and will be removed in a future release". Replace

import {StyleSheet, View, Dimensions, WebView} from 'react-native';

to

import {StyleSheet, View, Dimensions} from 'react-native';
import { WebView } from 'react-native-webview';

will remove the warning. However the white screen bug is back. I'll continue to use back WebView from react-native for now

You can keep track of the issue in react-native-webview

from react-native-highcharts.

shivamsingh262 avatar shivamsingh262 commented on June 9, 2024

Wow, thanks for this, I had been struggling with the same for days now

from react-native-highcharts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.