knownasilya / ember-toggle

Checkbox based Toggle Switches for Ember
http://knownasilya.github.io/ember-toggle/
MIT License
112 stars 52 forks source link

README example causes ember error #61

Closed vmalloc closed 7 years ago

vmalloc commented 7 years ago

Trying to create a simple controller with a boolean flag attribute, and the code:

{{x-toggle value=flag onToggle=(mut flag)}}

As taken from the README, Ember raises an error:

Assertion Failed: You modified flag twice on <webapp@controller:session/index::ember903> in a single render. This was unreliable and slow in Ember 1.x and is no longer supported. See https://github.com/emberjs/ember.js/issues/13948 for more details.

Tested with latest ember-cli-toggle (v2.0.2) and Ember 2.10

knownasilya commented 7 years ago

Thanks for reporting. This happens on initial page load, not when you click the toggle, correct?

lone-cloud commented 7 years ago

I'm running into the same issue on emberjs 2.10.2. Happens during the initial load. The stack trace of the failure is on the x-toggle component: line 47 -> 182

lone-cloud commented 7 years ago

Also I noticed that the double rendering issue happens only when the initial value is false.

knownasilya commented 7 years ago

Not undefined?

lone-cloud commented 7 years ago

correct

lone-cloud commented 7 years ago

Might have been an error on my side as I copied the example which was (mut myValue) instead of (action (mut myValue))

knownasilya commented 7 years ago

Give v3.0.0 a try.