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(global): Only cascade mode from parent *Ionic* components #20828

Merged
merged 8 commits into from Mar 25, 2020

Conversation

jakobe
Copy link
Contributor

@jakobe jakobe commented Mar 20, 2020

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: Fixes #20055

Wrapping an Ionic component in a non-Ionic element with a mode attribute throws error:

<p mode="foo">
  <ion-label></ion-label>
</p>

What is the new behavior?

Only apply the Ionic mode from Ionic ancestors.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@ionitron-bot ionitron-bot bot added the package: core @ionic/core package label Mar 20, 2020
Copy link
Member

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

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

Tested using dev build 5.1.0-dev.202003251635.54463b4

This is the expected behavior, with this PR:

Warning on foo, falls back to default mode:

<ion-toggle mode="ios"></ion-toggle>
<ion-toggle mode="md"></ion-toggle>
<ion-toggle mode="foo"></ion-toggle>

No warning, falls back to default mode:

<p mode="ios">
  <ion-toggle></ion-toggle>
</p>
<p mode="md">
  <ion-toggle></ion-toggle>
</p>
<p mode="foo">
  <ion-toggle></ion-toggle>
</p>

Warning on foo, falls back to default mode:

<ion-segment mode="ios">
  <ion-segment-button>Button</ion-segment-button>
  <ion-segment-button>Button</ion-segment-button>
</ion-segment>
<ion-segment mode="md">
  <ion-segment-button>Button</ion-segment-button>
  <ion-segment-button>Button</ion-segment-button>
</ion-segment>
<ion-segment mode="foo">
  <ion-segment-button>Button</ion-segment-button>
  <ion-segment-button>Button</ion-segment-button>
</ion-segment>

Thank you for this! Awesome change.

@jakobe
Copy link
Contributor Author

jakobe commented Mar 25, 2020

Great! The final changes looks great 👍

@brandyscarney
Copy link
Member

This will be in the 5.0.6 release we're releasing in a bit. Thanks again. 🙂

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.

bug: Setting [mode]=" 'not ios or md' " causes './undefined.entry.js' Error
4 participants