question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Toggle IonAccordion from Controller

See original GitHub issue

Feature Request

Ionic version:

[ ] 4.x [ ] 5.x [X] 6.x

Describe the Feature Request

I would like to toggle a specific Accordion from my Controller.

Describe Preferred Solution

In Angular:

@ViewChild('accordion')
accordion: IonAccordion;

someMethode() {
    this.accordion.toggle();
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
EinfachHanscommented, Jul 1, 2021

Okay understood 😊

1reaction
liamdebeasicommented, Jul 1, 2021

I don’t think that there would be extra programming for the user, as if we would use the same function like on the Accordion Click, the other Accordions would collapse (if not multiple) automatically?

In order to do this, ion-accordion would have to set the value of ion-accordion-group automatically which is a practice we moved away from with v5 because it caused a lot of synchronization issues (for example, we did this with radio: https://github.com/ionic-team/ionic-framework/blob/master/BREAKING.md#radio)

Glad setting the value property works. Also sorry I misspoke, accordion group does not have ngModel support since it’s not a form element.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug in Accordion and toggle widget - WordPress.org
I need you help. I am using free version. I already read and followed this new updates but not fixed the accordion widget...
Read more >
Uib accordion toggle issue - angularjs - Stack Overflow
I am using uibAccordion where the toggling is not happening properly, If I click 1st repeated element all others also opening. Below is...
Read more >
toggle accordion · Issue #56 · ember-bootstrap/ember-bootstrap ...
is there a property to toggle the accordion panel? forgive me, this is all new; using the example I can get them all...
Read more >
Collapse - Bootstrap
The collapse JavaScript plugin is used to show and hide content. Buttons or anchors are used as triggers that are mapped to specific...
Read more >
Accessible Accordion - examples and best practices - Aditus
Accordions are a common UX pattern that can help reduce the amount of information presented to users. You might recognise this pattern by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found