knownasilya / ember-toggle

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

Doesn't work in 2.10 #59

Closed sibijohn72 closed 7 years ago

sibijohn72 commented 7 years ago

It simply doesnt work in 2.10. I tried to set up a minimal toggle button in a new project but nothing happens to the button when i click. It does not toggle.

knownasilya commented 7 years ago

Thanks, will investigate.

lancedikson commented 7 years ago

@sibijohn72, could you provide some code? It would be nice to see on using of the component and your config for it at environment.js if it exists.

lancedikson commented 7 years ago

Btw, for me, it works well on 2.10.

cibernox commented 7 years ago

I can reproduce in 2.11. The problem seems to be that this component incorrectly call the onToggle function on init, causing the dread"Assertion Failed: You modified "v1" twice on <dummy@controller:application::ember294> in a single render.

I'm investigating a fix.

lancedikson commented 7 years ago

@cibernox, could you provide the code as well? Let us know how do you actually use the x-toggle component, please :)

cibernox commented 7 years ago

@lancedikson No need. The very test suite is a good example of the bug: https://travis-ci.org/knownasilya/ember-cli-toggle/jobs/196596235

avanov commented 7 years ago

What's the status of this issue? I've tried using it with ember-cli 2.11.1, and I see no widget on a page when I use the component (no errors in console though).

knownasilya commented 7 years ago

Did you try version 3.0?

avanov commented 7 years ago

@knownasilya yes, the latest one available on npm.

It turned out, that the default theme works fine

{{x-toggle
  value=myValue
  showLabels=true
  onLabel='Enabled::true'
  offLabel='Disabled::false'
  onToggle=(mut myValue)
}}

but then, as soon as I specify a non-default theme attribute, the widget renders only labels, without the control.

knownasilya commented 7 years ago

You must opt into other themes, see the configuration section in the readme.