PolymerElements / iron-form

Custom form element
https://www.webcomponents.org/element/PolymerElements/iron-form
63 stars 81 forks source link

Lint accuses `databind-with-unknown-property` warning on iron-form #293

Open wikedo opened 5 years ago

wikedo commented 5 years ago

Description

Running polymer linter on iron-form (2.x) gives warnings on the internal submission form due to the databinds with undeclared properties (action, method, enctype). I assume it should also happen for 3.x since the implementation is basically the same.

Expected outcome

Polymer linter should not accuse any warnings or errors.

Actual outcome

Polymer linter accuses databind-with-unknown-property on the iron-form's internal form:

    <form id="helper" action$="[[action]]" method$="[[method]]" enctype$="[[enctype]]"></form>
                                 ~~~~~~

.../bower_components/iron-form/iron-form.html(100,34) warning [databind-with-unknown-property] - action is not declared or used more than once. Did you mean: _init

    <form id="helper" action$="[[action]]" method$="[[method]]" enctype$="[[enctype]]"></form>
                                                      ~~~~~~

.../bower_components/iron-form/iron-form.html(100,55) warning [databind-with-unknown-property] - method is not declared or used more than once. Did you mean: detached

    <form id="helper" action$="[[action]]" method$="[[method]]" enctype$="[[enctype]]"></form>
                                                                            ~~~~~~~

.../bower_components/iron-form/iron-form.html(100,77) warning [databind-with-unknown-property] - enctype is not declared or used more than once. Did you mean: title

Steps to reproduce

Run polymer linter on iron-form (2.x)

wikedo commented 5 years ago

A straightforward solution would be to just declare those properties, but after going through the code I was wondering if those binds and the properties are actually needed. The properties are not cited in the public API docs and even if someone decided to actually bind them on an iron-form instance, the values bound to the submission form would be overwritten on submission, since the attributtes are either copied from the slotted form, or set to a default value. Maybe I'm missing something though...