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

Spoiler doesn't render label when inside Accordion.Item #1811

Closed
mateuszdziuba opened this issue Jul 18, 2022 · 4 comments · Fixed by #2037
Closed

Spoiler doesn't render label when inside Accordion.Item #1811

mateuszdziuba opened this issue Jul 18, 2022 · 4 comments · Fixed by #2037
Labels
help wanted Contributions from community are welcome

Comments

@mateuszdziuba
Copy link

What package has an issue

@mantine/core

Describe the bug

When placed inside Accordion component Spoiler component won't render labels, making it uncontrollable.

In which browser did the problem occur

Chrome, Firefox

If possible, please include a link to a codesandbox with the reproduced problem

https://codesandbox.io/s/cocky-jang-yfobyv?file=/src/App.js

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

No

Possible fix

No response

@khobiziilyes
Copy link
Contributor

Your content is just not long enough:
https://codesandbox.io/s/affectionate-hugle-xiy1qf

@mateuszdziuba
Copy link
Author

Still doesn't work for me. I think it might be related to this issue with spoiler and collapse #1158

@rtivital rtivital added the help wanted Contributions from community are welcome label Jul 25, 2022
@lawff
Copy link
Contributor

lawff commented Jul 26, 2022

Still doesn't work for me. I think it might be related to this issue with spoiler and collapse #1158

Yes, they are the same problem, the Collapse 'display: none' leading to the Spoiler content clientHeight to 0, so not show the label.

@wes337
Copy link
Contributor

wes337 commented Aug 7, 2022

I believe this is caused because we are setting the max height of the Spoiler component using its own offset height (which is 0 when collapsed inside the accordion).

It's checked in the useEffect on line 65 of the Spoiler component. It's calculated when the Spoiler component mounts and when the content updates (but not when you expand/collapse the Accordion).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions from community are welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants