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(vue): adding class to IonPage no longer hides component #25490

Merged
merged 8 commits into from
Jun 21, 2022
Merged

Conversation

liamdebeasi
Copy link
Contributor

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)
    • Some docs updates need to be made in the ionic-docs repo, in a separate PR. See the contributing guide for details.
  • 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 URL: Internal ticket

Dynamically adding a class to IonPage causes the component to re-render. This means that IonPage components used inside of IonRouterOutlet would get the .ion-page-invisible class re-added, even if it was removed: https://github.com/ionic-team/ionic-framework/blob/main/packages/vue/src/components/IonPage.ts#L13

This resulted in the IonPage component hiding when a custom class is added. Also, the custom class showed up twice because we re-added it in existingClasses: https://github.com/ionic-team/ionic-framework/blob/main/packages/vue/src/components/IonPage.ts#L20

What is the new behavior?

  • Removed existingClasses, so the custom class only shows up once.
  • Tweaked how we set ion-page-invisible. This class is now added in IonRouterOutlet (as it is only needed when using routing) when the IonPage component is mounted initially.
  • The private isInOutlet property on IonPage was used to determine when to add ion-page-invisible. As this class is now added by IonRouterOutlet, the isInOutlet property is no longer needed and has been removed.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the package: vue @ionic/vue package label Jun 16, 2022
@liamdebeasi liamdebeasi marked this pull request as ready for review June 16, 2022 17:58
@liamdebeasi liamdebeasi requested a review from a team as a code owner June 16, 2022 17:58
Copy link
Contributor

@sean-perkins sean-perkins left a comment

Choose a reason for hiding this comment

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

This looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: vue @ionic/vue package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants