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(modal): allow for custom dialog implementations #25630

Merged
merged 7 commits into from
Jul 15, 2022
Merged

fix(modal): allow for custom dialog implementations #25630

merged 7 commits into from
Jul 15, 2022

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Jul 13, 2022

Docs: ionic-team/ionic-docs#2444

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: resolves #24080

What is the new behavior?

  • Allows developers to use ion-modal without ion-content in order to make custom dialogs. It also allows developers to have these dialogs be automatically sized by the browser (such as width: fit-content)

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build: 6.1.15-dev.11657743655.1e3dcc3c

@github-actions github-actions bot added the package: core @ionic/core package label Jul 13, 2022
@liamdebeasi liamdebeasi marked this pull request as ready for review July 13, 2022 21:08
@liamdebeasi liamdebeasi requested a review from a team as a code owner July 13, 2022 21:08
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.

Nice work, opens up some creative options for modal implementations 🎉

@liamdebeasi liamdebeasi merged commit a6f3ae6 into main Jul 15, 2022
@liamdebeasi liamdebeasi deleted the FW-318 branch July 15, 2022 13:36
@EinfachHans
Copy link
Contributor

@liamdebeasi is this only for inline modals? Looks like it doesn't work for modals created via ModalController

@sean-perkins
Copy link
Contributor

@EinfachHans this applies to all modals. The style changes are to the inner .ion-page element for all modals.

Inline example: https://stackblitz.com/edit/angular-nagmrz?file=src%2Fstyles.css,src%2Fapp%2Fapp.component.html

Controller example: https://stackblitz.com/edit/angular-4sfe9x?file=src%2Fstyles.css,src%2Fapp%2Fmodal-example.component.html

@EinfachHans
Copy link
Contributor

@sean-perkins you're right, but doesn't work very well with ion-content inside of the modal 🤔

@sean-perkins
Copy link
Contributor

@EinfachHans The intention of this feature is to be used without ion-content. The use case is when you have a modal that you want to size to its content's height.

e.g.: https://raw.githubusercontent.com/ionic-team/ionic-framework/ef8c2baffcf6ca3bef89841e9c1c7cb557fe6ec7/core/src/components/modal/test/custom-dialog/modal.e2e.ts-snapshots/modal-custom-dialog-ios-ltr-Mobile-Chrome-linux.png

We are not intending this to be used in combination with ion-content at this time.

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 ion-modal width or height CSS properties to auto results in size of 0
5 participants