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

Programmaticaly expand an accordion only expand the v-pane-header but not the v-pane-content #62

Open
sebastienvermeille opened this issue Jun 15, 2016 · 1 comment

Comments

@sebastienvermeille
Copy link

Hi,
I have the following structure :

<v-pane expanded="true">
     <v-pane-header>    a header </v-pane-header>
     <v-pane-content>
            <v-accordion class="vAccordion--default" control="vm.accordionSerien" id="serie-accordion">
                 <v-pane ng-repeat="serie in vm.series"
                                 id="{{ serie.id }}">
                        <v-pane-header>SERIE</v-pane-header>
                        <v-pane-content class="subpane">
                             this content is never displayed and it should be
                        </v-pane-content>
                 </v-pane>
            </v-accordion>
     </v-pane-content>
</v-pane>

And in my controller I do :

$scope.$on('serie-accordion:onReady', function(){
      vm.accordionSerien.expand(currentSerieId); // This exand the menu header (so we see "SERIE (-) <-- because expanded) but below there is no content displayed. And if I set it manually to expanded=true then it works...
})

Any idea about the cause ? Thank you very much for your help

@AnirudhaGohokar
Copy link

AnirudhaGohokar commented May 11, 2017

Calling it inside timeout set to 0 seems to fix the issue.Seems like this forces it to be included in the immediate digest cycle.

$timeout(function () {
    vm.accordionSerien.expand(currentSerieId); 
},0);

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

No branches or pull requests

2 participants