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(overlays): getTop now returns the top-most presented overlay #24547

Merged
merged 9 commits into from
Jan 11, 2022

Conversation

sean-perkins
Copy link
Contributor

@sean-perkins sean-perkins commented Jan 10, 2022

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?

The logic for getTop does not take into consideration hidden overlays. With usages of an inline modal within a modal instance using a controller; you are unable to dismiss the modal using dismiss or getTop without an id.

Issue Number: #19111, #24545

What is the new behavior?

Only visible overlays are returned in getOverlay, used by the getTop logic.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Reproduction app: https://github.com/sean-perkins/gh-24545-modal-top

  • Install dev build:
npm i @ionic/[email protected]
npm i @ionic/[email protected]
  • Run app
  • Open modal with the button
  • Dismiss modal with the button

@sean-perkins sean-perkins requested a review from a team as a code owner January 10, 2022 22:38
@github-actions github-actions bot added the package: core @ionic/core package label Jan 10, 2022
@github-actions github-actions bot added the package: angular @ionic/angular package label Jan 11, 2022
Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

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

This is off to a great start 🚀 ! The angular test comment is not blocking, though it seems like we could simplify that by making it a test in core rather than angular.

angular/test/test-app/e2e/src/overlay-nested.spec.ts Outdated Show resolved Hide resolved
core/src/utils/overlays.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the package: angular @ionic/angular package label Jan 11, 2022
Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

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

Great job! One idea for the commit subject could be fix(overlays): getTop now returns the top-most presented overlay or something like that. getOverlay return visible overlay likely does not mean much to a dev since getOverlay is internal.

@sean-perkins sean-perkins changed the title fix(overlays): getOverlay return visible overlay fix(overlays): getTop now returns the top-most presented overlay Jan 11, 2022
@sean-perkins sean-perkins merged commit f5b4382 into main Jan 11, 2022
@sean-perkins sean-perkins deleted the FW-207 branch January 11, 2022 20:13
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.

3 participants