tannerlinsley / nz-toggle

Dual and triple-state toggles for AngularJS
http://codepen.io/anon/pen/yNjyME
40 stars 29 forks source link

Fix: Compatibility with md-virtual-repeater. Fire only on user event #41 #44

Open pvillaverde opened 6 years ago

pvillaverde commented 6 years ago

I've had some trouble when using nz-toggle with md-virtual-repeater. As ngModel was watched for changes and then updated. When Virtual repeater when you are scrolling down on a table, for example, each element was acting like if it has changed.

Solved by calling the update function onToggle only in the toggle function, instead of calling it on the watch.