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

fix(core): add slot elements to scoped "wrapper" components #29074

Conversation

tanner-reits
Copy link
Member

@tanner-reits tanner-reits commented Feb 21, 2024

Issue number: N/A


What is the current behavior?

Previously, Stencil would allow content to project through to a component even when a slot was not present. However, with the changes in extras.experimentalScopedSlotChanges, this behavior was changed to hide elements without a destination slot - matching the behavior of a shadow encapsulated component.

As such, elements projected through the ion-label or ion-buttons components would no longer be visible in rendered output.

What is the new behavior?

This commit adds an explicit slot tag to components in core leveraging "scoped" encapsulation with no rendered content (i.e. elements with only a Host tag and styles).

Does this introduce a breaking change?

  • Yes
  • No

Other information

This commit adds an explicit `slot` tag to components in core leveraging "scoped" encapsulation with no rendered content (i.e. elements with only a `Host` tag and styles).

Previously, Stencil would allow content to project through to a component even when a slot was not present. However, with the changes in `extras.experimentalScopedSlotChanges`, this behavior was changed to hide elements without a destination slot - matching the behavior of a shadow encapsulated component.
@github-actions github-actions bot added the package: core @ionic/core package label Feb 21, 2024
@tanner-reits tanner-reits marked this pull request as ready for review February 21, 2024 15:02
@tanner-reits tanner-reits requested a review from a team as a code owner February 21, 2024 15:02
@tanner-reits tanner-reits requested review from averyjohnston and removed request for a team February 21, 2024 15:02
@tanner-reits tanner-reits changed the title fix(core): add slot elements to scoped "wrapper" elements fix(core): add slot elements to scoped "wrapper" components Feb 21, 2024
@rwaskiewicz
Copy link
Member

@tanner-reits should we just merge this into the current target (my branch) and update my PR? Alternatively, I think you should be able to cherry-pick my commit onto your PR now that you have write permissions. Either way, I think that'll help give the Framework team a little more context as to what we're doing/that we're targeting a feature branch for both of our changes here. WDYT?

@tanner-reits
Copy link
Member Author

@rwaskiewicz I'll go ahead and merge this (don't know why I didn't do that earlier)

@tanner-reits tanner-reits merged commit ea211de into ionic-team:rwaskiewicz/enable-experimental-slot-fixes Feb 21, 2024
44 checks passed
@tanner-reits tanner-reits deleted the treits/fix/changes-for-slot-fix-flags branch February 21, 2024 22:13
rwaskiewicz pushed a commit that referenced this pull request Feb 22, 2024
Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Previously, Stencil would allow content to project through to a
component even when a slot was not present. However, with the changes in
`extras.experimentalScopedSlotChanges`, this behavior was changed to
hide elements without a destination slot - matching the behavior of a
shadow encapsulated component.

As such, elements projected through the `ion-label` or `ion-buttons`
components would no longer be visible in rendered output.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

This commit adds an explicit `slot` tag to components in core leveraging
"scoped" encapsulation with no rendered content (i.e. elements with only
a `Host` tag and styles).

## Does this introduce a breaking change?

- [ ] Yes
- [X] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
rwaskiewicz pushed a commit that referenced this pull request Feb 22, 2024
Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Previously, Stencil would allow content to project through to a
component even when a slot was not present. However, with the changes in
`extras.experimentalScopedSlotChanges`, this behavior was changed to
hide elements without a destination slot - matching the behavior of a
shadow encapsulated component.

As such, elements projected through the `ion-label` or `ion-buttons`
components would no longer be visible in rendered output.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

This commit adds an explicit `slot` tag to components in core leveraging
"scoped" encapsulation with no rendered content (i.e. elements with only
a `Host` tag and styles).

## Does this introduce a breaking change?

- [ ] Yes
- [X] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants