oncode / handorgel

Accessible W3C conform accordion written in ES6.
https://oncode.github.io/handorgel/
MIT License
261 stars 25 forks source link

Initialize with opened fold #36

Closed Mindless73 closed 3 months ago

Mindless73 commented 4 months ago

We are using Handorgel in a legacy .net Web Forms application. So far it works perfectly, except if we want to have an open fold after a postback (or partial postback).

We can open a fold with Accordion.folds[n].open(false) or with the data-open property, but the problem ist that the accordion gets initialized (with closed folds) after a postback and then we open the fold. This means there's a "blink" of the fold every time there is a postback.

Is there any way to initialize the accordion with an already opened fold?

oncode commented 4 months ago

Are you trying to avoid the initial transition? You can use initialOpenTransition: falseoption

Mindless73 commented 4 months ago

We initialize the accordion with initialOpenTransition: false and initialOpenTransitionDelay: 0

Here's how it looks: Test