-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Input type=checkbox isn't a component #5433
Comments
👍 Totally flaked out for a bit and thought that you were saying that you can't do This issue might also be slightly related to emberjs/rfcs#2 |
Making your own checkbox component is extremely straightforward: http://emberjs.jsbin.com/rwjblue/58/edit For the reasons stated in #3935 (comment) we cannot change |
I am absolutely sorry that this is mentally complicated, but we cannot change either |
@rwjblue we should consider introducing
The fact that the component syntax This will affect people who use reopen We might have to be careful how this is released, but it will prevent some early gray hair. |
Slight correction |
As a newcomer to Ember, a huge +1 from me (and everyone in my company) on cleaning this up for Ember 2.0 or whenever. We wasted a lot of time with this until we found this thread. |
@asteinlein I have also wasted an embarrassing amount of time on this one. @rwjblue you are correct via globals, but they can easily import / export Ember.CheckBox.extend in there own app and use I believe we should and can change |
@stefanpenner - I respectfully disagree. We cannot change But I do completely sympathize and want this changed to use a component in 2.0, if you recall I submitted a PR that did just that but the PR was declined because of SemVer impact. |
@rwjblue what about making a ember-cli addon version, for those suffering? |
@rwjblue what breaks? The past complaints where people who subclasses TextField for there own TextFields not the `{{input`` helper variant. |
@rwjblue ping. |
Any news on this one? |
Yeah, just got hit by that.. |
|
I reviewed this on the glimmer branch, it is not yet fixed. Checkbox still inherits |
👍 would love to see this behavior consistent in 2.0. |
just want to comment on @rwjblue x-checkbox component, you need to add |
Wasted so much time on this. At least put a warning, in bold, in the docs. It's a little misleading considering the 'actions' usage is explained only a line before 'checkboxes' on the Input Helpers guide page. |
@JKGisMe i feel ya, don't give up on ember due to this problem. i fully believe ember core team is going to make this a non-issue with ember 2.0! |
Well, I have a working, saving to the backend, checkbox. I used combination of the x-checkbox JSBin here and the explanation at http://www.thesoftwaresimpleton.com/blog/2015/02/12/emberjs-data-down/ The explanation was really helpful. I don't know when Ember 2.0 will come out but it seems like a slippery slope to delay workable solutions. Especially when the situation is not well documented. It's already hard enough for a noob when the internets are full of the 'old Ember way' and you're trying to implement things in the 'new Ember way'. There is no reason something like this checkbox debacle couldn't have been included on the Ember guides. Checkboxes are a pretty basic element. I guess I find this to be equal part issue with Ember itself and issue with Ember documentation. |
The recent blog post should provide more detail. |
@JKGisMe this is open source project, so please help to improve documentation or really anything in the code. Community would greatly appreciate that. |
@rwjblue thanks for that link. |
@Restuta I spent half my Sunday trying to make a checkbox. I don't think Ember wants me touching their code. ;) Since Ember 2.0 is so close. Let's just pause our work projects and come back after it's here. We can contribute to Ember in the meantime. |
I just ran into this and spent an hour on it until I gave up and finally found this. I hope this gets fixed for 2.0. |
Fixed in #11396 |
Yay, future generations of ember noobs will not know the struggle. 👍 |
Hey guys, quick question here to clear out some confusion. I was looking at the code change (#11396) to make checkbox extend from Does this change mean that with the next release of Ember we will be able to write:
If so, when will Related question: are we gonna be able to write something like:
My issue right now is that I'd like to be notified when the user toggles the checkbox but not when I programmatically change its value. The only way for now to be notified of a change is to set an observer on the checkbox's value. Unfortunately the observer is being triggered both when the user clicks on the checkbox and when I toggle its value programmatically. I was therefore wondering is that change would help me accomplish what I'm trying to do. |
@gzurbach in ember 1.13.3 you can do the following
|
Awesome, I will do that then. Thanks for your quick reply @stefanpenner, as always! |
@stefanpenner After an embarrassing amount of debugging, I can verify this should be
instead of
|
Although this issue was closed (#3935), I think it would be worthwhile to support
{{input type="checkbox" action="someaction"}}
.In developing my app I could not actually wire up an action to a checkbox in this manner.
Although according to the referenced issue this would be a "breaking change", I believe it would add symmetry (and reduce confusion)
cc @stefanpenner (this even confused the mighty one)
The text was updated successfully, but these errors were encountered: