react-native-collapse-view icon indicating copy to clipboard operation
react-native-collapse-view copied to clipboard

First all Items are open, then they collapse

Open xstable opened this issue 6 years ago • 3 comments

If I open the Screen with your component, all Text is visible. Aftter some seconds, each item get collapsed:

20180606_215759

What is the way to prevent showing collapsing at first load... instead only the headlines should appear. Is there a kind of flag or event which is fired, if all items are fully loaded and collapsed?

Here my code:

    _renderIconView = (data) => (collapse) => {
        const answer = <Text style={styles.headerText} >{data.frage}</Text >;
        return (
            <View style={styles.iconView} >
                <View >
                    {
                        collapse ?
                            <Icon name='chevron-down' type='Feather' color={cfg.fontLight} > {answer}</Icon > :
                            <Icon name='chevron-right' type='Feather' color={cfg.fontLight} > {answer}</Icon >
                    }
                </View >
            </View >
        )
    }
    _renderCollapseView = (data) => (collapse) => {
        console.log("collapes",collapse);
        return (
            <View style={styles.content} >
                <HTML html={data.antwort.replace(/\r?\n/g, " ")}
                      baseFontStyle={fontStyles}
                      tagsStyles={tagStyles}
                      onLinkPress={(event, href) => {
                          Linking.openURL(ParseUrl(href)).catch(e => console.log("Fehler beim Aufruf der url: " + href, e));
                      }}
                />
            </View >
        )
    }

    render() {
        console.log("ich render");
        return (
            <View style={styles.faqWrapper} >
                {this.props.faq.map((data, index) => {
                    return <CollapseView
                        key={index}
                                         tension={10}
                                         renderView={this._renderIconView(data)}
                                         renderCollapseView={this._renderCollapseView(data)}
                    />
                })
                }
            </View >
        );
    };
}

xstable avatar Jun 06 '18 20:06 xstable

I figured out... that slow is it only at debug-build. But on Release-Build you also see a small delay and flickering on startup

xstable avatar Jun 07 '18 16:06 xstable

I see the same results. Much less noticeable in production. Lag seems to increase with the number of items on the screen.

johnlaine1 avatar Jul 19 '18 16:07 johnlaine1

yes you are right when i putes countries names as items , it become more slowly and it don't show them all. there any other solution to fix that ?

aymen1989 avatar Apr 15 '19 09:04 aymen1989