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

React: CdsModal doesn't display when setting hidden={false} #122

Closed
3 of 8 tasks
ashleyryan opened this issue Jul 7, 2022 · 2 comments · Fixed by #123 or #133
Closed
3 of 8 tasks

React: CdsModal doesn't display when setting hidden={false} #122

ashleyryan opened this issue Jul 7, 2022 · 2 comments · Fixed by #123 or #133

Comments

@ashleyryan
Copy link
Contributor

ashleyryan commented Jul 7, 2022

Describe the bug

When setting the hidden prop to false on the CdsModal component, the modal is not visible. React sends a string to the DOM, so the attribute is hidden="false" but the hidden attribute should be removed, not set to false. See the spect https://www.w3.org/TR/2008/WD-html5-20080610/semantics.html#boolean

How to reproduce

https://stackblitz.com/edit/clarity-react-8em3m2?file=src%2FApp.tsx

Notice how the modal only appears if you conditionally render the modal only when hidden is false, or if you convert false to undefined

Expected behavior

The Modal would be visible with hidden=false like it is in V5: https://codesandbox.io/s/goofy-cori-wyy4eq?file=/src/App.tsx

Versions

Clarity project:

  • Clarity Core
  • Clarity Angular/UI

Clarity version:

  • v5.x
  • v6.x

Framework:

  • Angular
  • React
  • Vue
  • Other:

Framework version:
ie: Angular 11

Device:

  • Type: [e.g. MacBook]
  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional notes

Lit issue: lit/lit#3053

Related (closed) React Issue: facebook/react#9230 (comment)

@github-actions
Copy link

🎉 This issue has been resolved in version 6.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 2022
@ashleyryan ashleyryan reopened this Aug 2, 2022
ashleyryan pushed a commit to ashleyryan/core that referenced this issue Aug 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.