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

errors on destroying accordion #84

Open
k6jge3jf10o7 opened this issue May 16, 2019 · 2 comments
Open

errors on destroying accordion #84

k6jge3jf10o7 opened this issue May 16, 2019 · 2 comments

Comments

@k6jge3jf10o7
Copy link

In your demo if I open console and run disclosure.destroy() I get the following errors:
Chrome: "Cannot read property 'classList' of undefined"
Firefox: "heading is undefined"

@tomaszbujnowicz
Copy link

I use the accordion and there is an issue in the following function:

var unwrapInBtn = function (elem, settings) {
  ..
  heading.classList.remove(settings.headingClass);
  ..
};

Solution
Replace heading.classList with btn.parentNode.classList

var unwrapInBtn = function (elem, settings) {
  ..
  btn.parentNode.classList.remove(settings.headingClass);
  ..
};

@AwakenTheJaken
Copy link

+1 I am also running into this issue. We are attempting to recreate our instance of houdini on dynamically reloaded content. Could this be a bug in general or is the the way we are instantiating houdini? Below is the configuration we are using:

{
   "btnClass": "houdini-toggle",
   "isAccordion": true,
   "collapseOthers": false,
   "icon": false,
   "headingClass": "plus-minus-accordion-heading",
   "groupName": "Faqs_{{Group_ID}}"
}

Any insight on how to get around this would be awesome @cferdinandi ! Thank you :)

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

3 participants