Skip to content
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

Use template #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use template #58

wants to merge 1 commit into from

Conversation

timwis
Copy link

@timwis timwis commented Feb 14, 2016

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 default template? 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.

@@ -31,6 +31,12 @@ module.exports = View.extend({
}
},

template: [
'<form>',
'<fieldset data-hook="field-container"></fieldset>',
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants