You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.
I am writing a Polymer 2 element that decorated <iron-form>
My element needs to work with <iron-form>and the form itself that is decorated by <iron-form> -- which is stored as _form in the <iron-form> element.
At the moment I have this:
ready () {
super.ready()
var self = this
this.ironForm = this.allChildrenNamed('IRON-FORM', true)
if (!this.ironForm) throw new Error('hot-form must contain an iron-form element which will be decorated')
setTimeout(function () {
self.form = self.ironForm._form
}, 0)
}
Is this a reliable way to go about this?
WIth that setTimeout, <iron-form> has enough time to assign _form. Will this be the case longer-term? @TimvdLippe commeted here: Polymer/polymer#5149
There might be a case where iron-form is not attached yet, as the assignment to _form is in that callback (
) I do not think setTimeout is 100% reliable, but it will probably work in most cases.
Since this is mostly an iron-form specific question, I would advise to open an issue there and potentially request a new event to be notified when _form is set, in the attached callback.
Would you accept a PR with the addition of the newly emitted event?
Or, what would you advise?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am writing a Polymer 2 element that decorated
<iron-form>
My element needs to work with
<iron-form>
and the form itself that is decorated by<iron-form>
-- which is stored as_form
in the<iron-form>
element.At the moment I have this:
Is this a reliable way to go about this?
WIth that setTimeout,
<iron-form>
has enough time to assign _form. Will this be the case longer-term?@TimvdLippe commeted here: Polymer/polymer#5149
Would you accept a PR with the addition of the newly emitted event?
Or, what would you advise?
The text was updated successfully, but these errors were encountered: