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

Error fix in accordian #2666 issue fix #1 #2684

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

qburst-harikrishnanp
Copy link

  • Bug fix
  • New feature
  • Chore
  • Breaking change
  • There is an open issue which this change addresses
  • I have read the CONTRIBUTING document.
  • My commits follow the Git Commit Guidelines
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • My change requires a change to Typescript typings.
    • I have updated the typings accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@qburst-harikrishnanp
Copy link
Author

@illiteratewriter @aaronmars Please approve

@qburst-harikrishnanp
Copy link
Author

@illiteratewriter @aaronmars Please approve

@illiteratewriter
Copy link
Member

The classes object which contain .accordion-collapse is supposed to be in the parent of .accordion-body (Accordion Bootstrap).

@qburst-harikrishnanp Can you let us know what exactly you're trying to achieve with this particular PR?

@febababy
Copy link

@illiteratewriter
The PR is regarding the issue from #2681 to set styles to accordion-body.
There is a warning msg while using the accordion, #2666. This is due to the undefined while using setOpen props.

This PR will resolve both the above mentioned issues.

@illiteratewriter
Copy link
Member

The current PR has the issue that it is changing the structure of how accordion works in bootstrap. In Bootstrap docs the accordion works as following:

<div class="accordion-collapse collapse">
 <div class="accordion-body">
  This is the second item's accordion body.
  </div>
</div>

As you can see, .accordion-body is the child of .accordion-collapse. But according to this PR, in the output we get something like:

<div class="collapse">
 <div class="accordion-body accordion-collapse ">
  This is the second item's accordion body.
  </div>
</div>

This also breaks the library for those who have applied classes previously, because there is a change in behavior.

The solution to this would be to add an additional prop, something like bodyClassName which can be applied to the second div. In essence, we would keep the className prop working like how it was previously and add a new prop (bodyClassName) to add custom classes to accordion body.

Modal.js implements something similar to this. You can look at it for inspiration.

Let me know if you have any questions.

@febababy
Copy link

Thanks for the input.

@febababy
Copy link

PR updated with issue fix for #2666 , reverted the changes done for #2681.

image

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.

None yet

3 participants