triniwiz / nativescript-accordion

Apache License 2.0
38 stars 14 forks source link

Problem rendering within a ScrollView layout #35

Closed RadouaneRoufid closed 6 years ago

RadouaneRoufid commented 6 years ago

I'm using Accordion in my nativescript-angular app. Accordion works great within a Stack ou Grid Layout. But It does not render correctly within a ScrollView.

To reproduce :

<ScrollView>
    <GridLayout>
    <Accordion [items]="items">

        <ng-template accordionHeaderTemplate let-item="item" let-i="index">
            <GridLayout backgroundColor="blue" columns="auto,*">
                <Label [text]="item.name"></Label>
            </GridLayout>
        </ng-template>

        <ng-template accordionItemTemplate let-item="item">
            <StackLayout>
                <Label [text]="item.name"></Label>
            </StackLayout>
        </ng-template>

    </Accordion>
    </GridLayout>
</ScrollView>
triniwiz commented 6 years ago

I haven’t tried this but accordion is basically a fancy listview which has a scroll already so you would be stacking scrollviews

RadouaneRoufid commented 6 years ago

The problem is that all the content after my accordion is hidden when I collapse the accordion. The only solution I found for now is ScrollView !!

triniwiz commented 6 years ago

Ok I’ll look into this does it happen on both platforms?

RadouaneRoufid commented 6 years ago

I only tested on an android platform.

venkateshsj commented 6 years ago

I too checked the same. If the accordion is anywhere inside a ScrollView, it does not function as expected. I created a separate page with accordion without ScrollView on the page and it worked as expected.

Observed this issue on Android. I have not checked it on iOS. I will report as soon as I can check it on iOS.

Any suggestions/solutions are welcome to resolve this issue, without it this plugin is not usable.

triniwiz commented 6 years ago

It should be possible if you use this