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

docs: deprecate add custom-content slot for dialog component #11072

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

DitwanP
Copy link
Contributor

@DitwanP DitwanP commented Dec 16, 2024

Related Issue: #10323

Summary

Deprecates the "content" slot in favor of a new "custom-content" slot that will clearly describes the behavior that a user can expect. This change should solve the issue of confusion that we've heard about from internal feedback.

The description of the new slot would be:

custom-content - A slot for displaying custom content. Will prevent the rendering of any default Dialog UI, except for box-shadow and corner-radius.

@github-actions github-actions bot added the docs Issues relating to documentation updates only. label Dec 16, 2024
…nto dit13711/10323-rename-dialog-content-slot
@@ -50,7 +50,8 @@ let initialDocumentOverflowStyle: string = "";

/**
* @slot - A slot for adding content.
* @slot content - A slot for adding custom content.
* @slot content - [Deprecated] Use `custom-content` slot instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DitwanP we would actually need to add this slot in the code. It not just a doc change.

I'm kinda unsure how this change would work without being breaking since we put the panel inside the content slot by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@driskull Yeah good point. That being said, what are your thoughts on changing the slot to the new one overall? Are you in favor or not in favor of such a change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor of it, i'm just not sure how it will work exactly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this coincide with the rest of 3.0 breaking changes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats a question for @jcfranco

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we deprecate (w/o removing) "content" slot and add "custom-content"? That wouldn't be breaking as the recommendation is to use the "unnamed" default slot, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is we put default content in the content slot now. So we don't have a good way to counter that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, we can't have this in both the content and custom-content slots or it would show up twice.

   <slot name={SLOTS.content}>
            <calcite-panel
              beforeClose={this.beforeClose}
              class={CSS.panel}
              closable={!this.closeDisabled}
              closed={!opened}

I don't think we can do this right?

<slot name="custom-content">
            <slot name={SLOTS.content}>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That... does seem to work pretty well, in local testing...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well i'll be... 🤯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Issues relating to documentation updates only.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants