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

Allow the 'collapse' component to have a default-open + make collapse-arrow clickable #232

Closed
willemmulder opened this issue Oct 8, 2021 · 3 comments
Assignees
Labels

Comments

@willemmulder
Copy link

We use the 'collapse' component (amongst others), which works great!

However we'd very happy with two additional features:

  • Allowing for a default-open? Right now, it is always default-closed, but we actually like to have it default-open.
  • Make the collapse-arrow (and plus sign) clickable when using checkbox. Right now, the 'top bar' is clickable, but the actual collapse-arrow and plus sign is not...

Thanks! :-)

@saadeghi
Copy link
Owner

saadeghi commented Oct 8, 2021

@willemmulder

  1. You can use the checkbox and if the checkbox is checked by default, collapse will be open by default:
<div class="collapse w-96">
  <input type="checkbox" checked> 
  <div class="collapse-title text-xl font-medium">I'm open by default</div> 
  <div class="collapse-content"> 
    <p>Collapse content reveals with focus. If you add a checkbox, you can control it using checkbox instead of focus. Or you can force-open/force-close using collapse-open and collapse-close classes.</p>
  </div>
</div> 
  1. I will fix the arrow click this weekend.

@willemmulder
Copy link
Author

Hi @saadeghi Thanks for the response and quick action!

  1. Ah makes so much sense; should have seen that myself ;-)
  2. Great! Hopefully a 'pointer-events: none;' on the arrow/plus-sign might do the trick?

Thanks again, and have a good weekend for now!

@saadeghi saadeghi self-assigned this Oct 9, 2021
@willemmulder
Copy link
Author

Thanks, great!

inorganik pushed a commit to inorganik/daisyui that referenced this issue Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants