Repository navigation
chore(angular): log error when attempting to use reserved prop with modals and popovers - #27491
Merged
Merged
Conversation
added 11 commits
May 11, 2023 13:35
|
|
averyrousseau
marked this pull request as ready for review
May 16, 2023 19:45
brandyscarney
pushed a commit
that referenced
this pull request
May 22, 2023
…odals and popovers (#27491) Issue number: resolves #27205 --------- <!-- 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. --> If an Angular component that makes use of `ModalController` or `PopoverController` has a property of its own named `modal` or `popover` respectively, this will collide with an internal reference to the modal/popover element and cause errors. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> The actual behavior is unchanged, but a console error is logged guiding the developer on how to fix the issue. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> I used the original reproduction from the issue to test. Full steps: 1. Clone the repo: https://github.com/Asac2142/expenses 2. Run `git checkout ef95c2e80a9991fe958d628f17ecc4e862c834ef` to get to the app's state from when the issue was originally posted. Observe that the component in `src/app/home/create-transaction` has a private prop named `modal`. 3. Run `npm install`, then install the dev build: `npm install @ionic/[email protected]` 4. Run `ionic serve`. Click the fab button in the lower right. Observe the console error. If you scroll down in the modal and click the Category button, this will trigger the originally-reported issue. 5. Rename the private `modal` variable to something else, like `_modal`. 6. Refresh the page and re-open the modal. Note that no error is logged, and the Category button can be clicked to open another modal without issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves #27205
What is the current behavior?
If an Angular component that makes use of
ModalControllerorPopoverControllerhas a property of its own namedmodalorpopoverrespectively, this will collide with an internal reference to the modal/popover element and cause errors.What is the new behavior?
The actual behavior is unchanged, but a console error is logged guiding the developer on how to fix the issue.
Does this introduce a breaking change?
Other information
I used the original reproduction from the issue to test. Full steps:
git checkout ef95c2e80a9991fe958d628f17ecc4e862c834efto get to the app's state from when the issue was originally posted. Observe that the component insrc/app/home/create-transactionhas a private prop namedmodal.npm install, then install the dev build:npm install @ionic/[email protected]ionic serve. Click the fab button in the lower right. Observe the console error. If you scroll down in the modal and click the Category button, this will trigger the originally-reported issue.modalvariable to something else, like_modal.