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

bug: changetracking not working inside of modal #24651

Closed
4 of 6 tasks
maaker48 opened this issue Jan 25, 2022 · 3 comments
Closed
4 of 6 tasks

bug: changetracking not working inside of modal #24651

maaker48 opened this issue Jan 25, 2022 · 3 comments
Labels
ionitron: needs reproduction a code reproduction is needed from the issue author

Comments

@maaker48
Copy link

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

We have a list of action components, those components when clicked spawn an ion-modal.

<ion-modal trigger="modal-{{ a.busyDayId }}" [showBackdrop]="true">

<app-busy-day [a]="a">

When inside the app-busy-day component change detection does not seem to work.
template has {{counter}}
component has this.counter = this.counter + 1;
Counter in template does not increment, only after using changeDectectorRef

Expected Behavior

Change detection should work as normal.

Steps to Reproduce

spawn an inline modal with a component, bind an object to it [passableObject] = data
component uses this as @input passableObject,
define a counter on the component, and try to use a button to increment the counter.
display counter in template as

{{counter}}

Code Reproduction URL

No response

Ionic Info

$ ionic info
[WARN] Error loading @capacitor/ios package.json: Error: Cannot find module '@capacitor/ios/package'

   Require stack:
   - C:\Users\-\AppData\Roaming\npm\node_modules\@ionic\cli\lib\project\index.js
   - C:\Users\-\AppData\Roaming\npm\node_modules\@ionic\cli\lib\index.js
   - C:\Users\-\AppData\Roaming\npm\node_modules\@ionic\cli\index.js
   - C:\Users\-\AppData\Roaming\npm\node_modules\@ionic\cli\bin\ionic

[WARN] Error loading @capacitor/android package.json: Error: Cannot find module '@capacitor/android/package'

   Require stack:
   - C:\Users\-\AppData\Roaming\npm\node_modules\@ionic\cli\lib\project\index.js
   - C:\Users\-\AppData\Roaming\npm\node_modules\@ionic\cli\lib\index.js
   - C:\Users\-\AppData\Roaming\npm\node_modules\@ionic\cli\index.js
   - C:\Users\-\AppData\Roaming\npm\node_modules\@ionic\cli\bin\ionic

Ionic:

Ionic CLI : 6.18.1 (C:\Users-\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 6.0.3
@angular-devkit/build-angular : 13.0.4
@angular-devkit/schematics : 13.0.4
@angular/cli : 13.0.4
@ionic/angular-toolkit : 5.0.3

Capacitor:

Capacitor CLI : 3.3.3
@capacitor/android : not installed
@capacitor/core : 3.3.3
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 1.5.0

System:

NodeJS : v16.13.2 (C:\Program Files\nodejs\node.exe)
npm : 8.1.2
OS : Windows 10

Additional Information

Using changetracking like,

private ref: ChangeDetectorRef

this.a.counter++;
this.ref.detectChanges();

Does update counter properly.

@ionitron-bot ionitron-bot bot added the triage label Jan 25, 2022
@liamdebeasi liamdebeasi added the ionitron: needs reproduction a code reproduction is needed from the issue author label Jan 25, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Jan 25, 2022

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

@ionitron-bot ionitron-bot bot removed the triage label Jan 25, 2022
@Webrow
Copy link

Webrow commented Jan 26, 2022

Can be closed, we couldn't find the issue cause we didnt understand the origin of it. Updating to 6.0.3. fixes the issue,
I assume its
angular: attach change detector ref for inline overlays (#24521) (5c54593), closes #24502
This fix in particular that makes it work. We close the issue.

@ionitron-bot
Copy link

ionitron-bot bot commented Feb 25, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Feb 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ionitron: needs reproduction a code reproduction is needed from the issue author
Projects
None yet
Development

No branches or pull requests

3 participants