I can't get the accordion to work on the form display.

I added a group set to accordion and two other nested ones set to accordion item. Nested inside the accordion items I placed an image field in each one. It gets rendered correctly but both fields are opened. I looked at the rendered code and the h3 tag for each field has the field-group-accordion-active class. Is there a something else I need to download to make the javascript work??

I'm using Drupal 8.1, with PHP 5.6 on Ubuntu 14.04

Any help would be appreciated.

Thanx

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chavab_1 created an issue. See original summary.

ozin’s picture

Priority: Normal » Major
Status: Active » Needs work
FileSize
1.05 KB

The problem was in accordion.js file. Patch attached, please check.

chavab_1’s picture

I applied the patch but it's still not working. I get the same rendered results. The wrapping div and the H3 are added but all items are displayed open.

ozin’s picture

Hi @chavab_1 . You need to use 8.x-1.x-dev version of the module or add changes from this commit before applying this patch.

chavab_1’s picture

Hey @ozin. Thank you very much!! This works exactly as expected. Great work!!

chavab_1’s picture

One minor thing. Even if I select the "Closed" by default, the items still appear open by default. Is there a setting that I'm missing or is it something else??

Thanx

ozin’s picture

Status: Needs work » Needs review
FileSize
1.85 KB

Hi @chavab_1
Good catch! It was the bug with the formatter settings. Please check my new patch.

chavab_1’s picture

Perfect!! That did the job.
Thanx a lot man!!

gtsopour’s picture

This patch field_group-accordion-not-working-2729569-2.patch worked for me too.
Thanks

webflo’s picture

Version: 8.x-1.0-rc4 » 8.x-1.x-dev
Component: Miscellaneous » Code
Category: Support request » Bug report
Issue tags: -accordion +DevDaysMilan

I work on a test.

gngn’s picture

patch at #7 worked for me too, applied to current dev 8.x-1.0-rc4+24-dev (2016-06-25).
Thank you.

chavab_1’s picture

Thanx gngn!! Was waiting for this patch to be applied so I can update my version.

leraa’s picture

#7 patch worked for me as well, using 8.1.5 core. Thank you!

acrollet’s picture

Status: Needs review » Reviewed & tested by the community

code looks good, patch fixes the problem - marking RTBC

Tom Nelson’s picture

Sorry, posted here in error.

  • zuuperman committed 67dd229 on 8.x-1.x authored by ozin
    Issue #2729569 by ozin: Accordion not working
    
nils.destoop’s picture

Status: Reviewed & tested by the community » Fixed

Thx for the patch. I can confirm that it's working, and committed it to dev

ozin’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.