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

CdsModalActions is not visible when rendered after a timeout #188

Closed
3 of 8 tasks
astorije-vmware opened this issue Oct 27, 2022 · 3 comments · Fixed by #190
Closed
3 of 8 tasks

CdsModalActions is not visible when rendered after a timeout #188

astorije-vmware opened this issue Oct 27, 2022 · 3 comments · Fixed by #190
Labels

Comments

@astorije-vmware
Copy link

Describe the bug

When CdsModalActions is rendered after a timeout, nothing appears. This is better demonstrated on the sandbox below.

How to reproduce

Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/cds-modal-actions-timeout-7xpf0c
  2. Click on "Open modal"
  3. Wait 3 seconds to see the content change. When that happens, the actions should be visible as well, but they are not.

Expected behavior

The button should appear at the same time as the content changes.

Versions

Clarity project:

  • Clarity Core
  • Clarity Angular/UI

Clarity version:

  • v5.x
  • v6.x

Framework:

  • Angular
  • React
  • Vue
  • Other:

Framework version:

React 18

Additional notes

This can be mitigated by rendering the button conditionally only, and not the CdsModalActions container, but when doing so I run into #187.

@ashleyryan
Copy link
Contributor

I think I know why this is happening and I'm trying to think of the best way to fix it without messing up all of the CSS.

We conditionally render the footer slot, if it's supplied. This works for the first render. The problem is that after the first render, that slot no longer exists, so when you try and add content with that slot name, it has nowhere to go. I think we need to get rid of the gap the cds-layout uses and conditionally apply top margin if the footer slot exists instead.

ashleyryan pushed a commit to ashleyryan/core that referenced this issue Nov 2, 2022
- the slot decorator doesnt update when the slot changes, so a slot listener must be added
- a slot lister cannot be added to a slot that doesnt exist
- instead, always render the slot, but use the hidden attribute
- the slot change event will force the component to update and get the new value of the slot property

fixes vmware-clarity#188
ashleyryan pushed a commit to ashleyryan/core that referenced this issue Nov 2, 2022
- the slot decorator doesnt update when the slot changes, so a slot listener must be added
- a slot lister cannot be added to a slot that doesnt exist
- instead, always render the slot, but use the hidden attribute
- the slot change event will force the component to update and get the new value of the slot property

fixes vmware-clarity#188
ashleyryan pushed a commit to ashleyryan/core that referenced this issue Nov 2, 2022
- the slot decorator doesnt update when the slot changes, so a slot listener must be added
- a slot lister cannot be added to a slot that doesnt exist
- instead, always render the slot, but use the hidden attribute
- the slot change event will force the component to update and get the new value of the slot property

fixes vmware-clarity#188
ashleyryan pushed a commit to ashleyryan/core that referenced this issue Nov 2, 2022
- the slot decorator doesnt update when the slot changes, so a slot listener must be added
- a slot lister cannot be added to a slot that doesnt exist
- instead, always render the slot, but use the hidden attribute
- the slot change event will force the component to update and get the new value of the slot property

fixes vmware-clarity#188
ashleyryan pushed a commit that referenced this issue Nov 3, 2022
- the slot decorator doesnt update when the slot changes, so a slot listener must be added
- a slot lister cannot be added to a slot that doesnt exist
- instead, always render the slot, but use the hidden attribute
- the slot change event will force the component to update and get the new value of the slot property

fixes #188
@github-actions
Copy link

github-actions bot commented Nov 7, 2022

🎉 This issue has been resolved in version 6.2.2 🎉

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 Nov 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants