Conversation
|
|
||
| template: [ | ||
| '<form>', | ||
| '<fieldset data-hook="field-container"></fieldset>', |
There was a problem hiding this comment.
I used a fieldset, which from what I understand is the most appropriate field container element. Technically you could do without this line and put the data-hook in the <form> (or even leave the hook out because it defaults to the <form> element if no hook is found). And of course this can be overridden when extending the form view or instantiating it (with an option).
There was a problem hiding this comment.
i'm not opposed to a fieldset. i would consider this a breaking change however, as any DOM node type or hierarchy manipulations will impact folks' CSS rules. it may also be a nice addition for some people to have more immediate structure. the counter to this is that it's not strictly necessary/bare-minimum, and is easily overridden with a template
There was a problem hiding this comment.
Good point, particularly the last one. In that case, I can update it to remove the <fieldset> tag and put data-hook="field-container" in the <form> tag.
Following our conversation in #57, I figured it would more consistent with the other views (including form views) to implement this. Should be a non-breaking change. I'll make a few notes on the code changes for background.
If you're into this, I'd suggest we should update the documentation to reflect this ability.
Lastly, what do you think about including a
<button type="submit">Submit</button>in the defaulttemplate? I personally can't think of a scenario where that wouldn't be useful, but I realize I may not understand all of the use cases of this module.