Skip to content

Fix data-bs-parent#62

Closed
JimiRecard wants to merge 1 commit into
django-crispy-forms:mainfrom
JimiRecard:patch-2
Closed

Fix data-bs-parent#62
JimiRecard wants to merge 1 commit into
django-crispy-forms:mainfrom
JimiRecard:patch-2

Conversation

@JimiRecard

Copy link
Copy Markdown
Contributor

Currently, we get a JS error (Uncaught TypeError: 'querySelectorAll' called on an object that does not implement interface Element.)

This, as is, fixes the expected default behavior (see https://getbootstrap.com/docs/5.0/components/accordion/#example).
If implemented the right kwarg in Container class on bootstrap.py, this will also allow for the always open behavior (see https://getbootstrap.com/docs/5.0/components/accordion/#always-open), since all we need is get rid of data-bs-parent.

Currently, we get a JS error (Uncaught TypeError: 'querySelectorAll' called on an object that does not implement interface Element.)

This, as is, fixes the expected default behavior (see https://getbootstrap.com/docs/5.0/components/accordion/#example).
If implemented the right kwarg in Container class on bootstrap.py, this will also allow for the always open behavior (see https://getbootstrap.com/docs/5.0/components/accordion/#always-open), since all we need is get rid of data-bs-parent.
@smithdc1

Copy link
Copy Markdown
Member

Thanks for the PR. 👍

Could you have a look at fixing the tests.

It would also be great to see a test for the second use case you describe. We should then add a note to the readme as I think this would be a new feature for the bs5 template pack.

@JimiRecard

Copy link
Copy Markdown
Contributor Author

Yeah, I'll take a look at the tests. I was honestly not expecting them to fail, but then again, who expects that, right?

I agree, the readme note is a nice touch. I tried to follow the same principle already used for the active=True kwargs, so it should be straightforward.

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

Successfully merging this pull request may close these issues.

2 participants