Fix SC.Button form submission issues by adding a configurable type property#11
Fix SC.Button form submission issues by adding a configurable type property#11wycats merged 7 commits intoemberjs:masterfrom
Conversation
|
Can you include test cases? |
|
How do those look? |
|
Ah, I'd been trying something similar and also noticed that my renderBuffer wasn't being called, so I ended up overriding applyAttributesToBuffer like this: applyAttributesToBuffer: function(buffer) { WDYT? |
|
I think that the Handlebars view helper should be calling into the view it's rendering to use it's renderBuffer rather than ignoring it and creating one in the view helper. |
|
I'm not super comfortable with overriding the render buffer to add attributes. Maybe we should consider switching SC.Button to use a defaultTemplate, like SC.Checkbox does? |
|
I had to take a similar approach for wrapping native Using the collection helper so I could use With native form controls there's occasionally a need to set the tagName and be able to supply certain attributes on the DOM representation. I also couldn't find another way to accomplish this currently except for overriding Maybe have an array of properties that, when set on the view, are passed to the element? Or having a similar approach to |
|
tomdale: The problem with using a defaultTemplate is that SC.Button uses the button tag which has it's value rendered inside of the tag, rather than as an attribute. AFAIK there isn't a way to render the content provided within the #view block in a defaultTemplate. Greg blogged about creating a TextArea view, which has the same problem. Would you rather it be implemented like he did? http://blog.sproutcore.com/dispatches-from-the-edge-handlebars-without-spans/#more-1332 |
|
Actually, the TextArea is different. It doesn't use a #view block helper, so that makes it easier. |
|
I'll add attribute/attribute binding support to make this work. |
…derBuffer of childViews.
Fix SC.Button form submission issues by adding a configurable type property
…ntent during the arrayDidChange handler. This causes the modelCache in ModelArray to be out of sync. Fix was to change the order of the _super call. In general, this code seems dangerous to update the modelCache in these places.
ember-handlebars/lib/controls/text_support.js
No description provided.