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

ionSwipe in beta 11 and data binding #7630

Closed
m5rk opened this issue Aug 9, 2016 · 8 comments
Closed

ionSwipe in beta 11 and data binding #7630

m5rk opened this issue Aug 9, 2016 · 8 comments
Assignees
Milestone

Comments

@m5rk
Copy link
Contributor

m5rk commented Aug 9, 2016

Short description of the problem:

Changes made to an item via (ionSwipe)="someFunction(item)" are not reflected as expected.

What behavior are you expecting?

I expected the modifications made as a result of swiping to be reflected in the page.

Steps to reproduce:

  1. See this repo
  2. Clicking the item toggles it. Swiping it does not.
insert any relevant code between the above and below backticks

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

Which Ionic Version? 1.x or 2.x

v2 beta 11. This code worked as expected with beta 10.

Run ionic info from terminal/cmd prompt: (paste output below)

Your system information:

Cordova CLI: 6.2.0
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.32
Ionic App Lib Version: 2.0.0-beta.18
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X Yosemite
Node Version: v6.2.2
Xcode version: Xcode 7.2.1 Build version 7C1002

@jgw96
Copy link
Contributor

jgw96 commented Aug 10, 2016

Made a more minimal repo here with the latest nightly that shows that if you put the logic inside a zone.run() that it works. If the logic is not inside a zone.run it does not.

@jgw96
Copy link
Contributor

jgw96 commented Aug 10, 2016

Also, i can confirm that this seems to be limited too "gesture" event emitters like ionSwipe and ionDrag

@m5rk
Copy link
Contributor Author

m5rk commented Aug 11, 2016

@jgw96 Thanks for the zone.run(() => { ... } workaround. That allows me to get back on track with beta 11.

@jgw96
Copy link
Contributor

jgw96 commented Aug 11, 2016

note to team: Seeing some really weird stuff with zone. The gif below shows everything.

untitled-screencast

The template variable that im changing to make *ngIf hide the button with the ionSwipe event does not cause the template to update and does not appear to run in zone. But, when i do something that does run in zone, like a click event, then the template gets updated (as you can see by the button disappearing).

@manucorporat
Copy link
Contributor

@jgw96 the gif is not longer working. what is this issue about? sliding item?

@jgw96
Copy link
Contributor

jgw96 commented Aug 22, 2016

@manucorporat hmm the gif seems to be working for me still? This is about the (ionSwipe) event on sliding lists. It does not seem to run in zone properly.

@fknop
Copy link

fknop commented Aug 23, 2016

I had the same issue with ionSwipe. I believe the gesture event is not running in the NgZone, so it's not triggering any change detection. But as soon as you're emitting a event in the NgZone like a click, the change detection triggers and the view is updated.

@manucorporat
Copy link
Contributor

@m5rk @fknop fixed!

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants