nested iron-forms overwrite element._parentForm
Description
https://github.com/PolymerElements/iron-form/blob/master/iron-form.html#L349
Expected outcome
Either the first form which gets the iron-form-element-register event should be the parentForm or there should be an array of parentForm's.
Actual outcome
The last form which gets the iron-form-element-register event becomes the parent form.
Steps to reproduce
<form id="outer" is="iron-form">
<form id="inner" is="iron-form">
<paper-input id="input" name="input"></paper-input>
</form>
</form>
input._parentForm === outer
Browsers Affected
Chrome for sure.
- [X] Chrome
- [ ] Firefox
- [ ] Safari 9
- [ ] Safari 8
- [ ] Safari 7
- [ ] Edge
- [ ] IE 11
- [ ] IE 10
This appears to be how <form> works as well, so I think the current behavior might be the expected behavior. According to the spec nested forms shouldn't be supported at all really. @notwaldorf WDYT?
From https://www.w3.org/TR/html5/forms.html#association-of-controls-and-forms,
A form-associated element is, by default, associated with its nearest ancestor form element (as described below), but, if it is reassociateable, may have a form attribute specified to override this.
This would seem to imply that the inner form should be it's parent.