I'm not sure that this error is limited to <core-input> or if it is a more general Polymer lifecycle issue so please read on to see what you think.
When setting a data-bound tabindex attribute on <paper-input> or <core-input> an error is thrown from core-input::handleTabIndex() that originates in core-input::attributeChanged().
The issue is that <core-input> uses the attributeChanged() lifecycle method which seems to fire before the ready() lifecycle method when there is bound data. The question that affects Polymer generally is whether or not this is the correct timing. Should attributeChanged() run before ready?
My guess is that it should but if there are other places in the Polymer web components collection that rely on attributeChanged() they may similarly have issues with data binding.
Fixing the specific problem with <core-input> is a simple matter of using a property change watcher rather than the attributeChanged() lifecycle method as the ready() lifecycle method already forces a run of handleTabindex(). I'm submitting a PR with that change in it.
I'm not sure that this error is limited to
<core-input>
or if it is a more general Polymer lifecycle issue so please read on to see what you think.When setting a data-bound
tabindex
attribute on<paper-input>
or<core-input>
an error is thrown fromcore-input::handleTabIndex()
that originates incore-input::attributeChanged()
.I've submitted a PR that fixes this issue.
Here's the output from the test code below:
The issue is that
<core-input>
uses theattributeChanged()
lifecycle method which seems to fire before theready()
lifecycle method when there is bound data. The question that affects Polymer generally is whether or not this is the correct timing. ShouldattributeChanged()
run beforeready
?My guess is that it should but if there are other places in the Polymer web components collection that rely on
attributeChanged()
they may similarly have issues with data binding.Fixing the specific problem with
<core-input>
is a simple matter of using a property change watcher rather than theattributeChanged()
lifecycle method as theready()
lifecycle method already forces a run ofhandleTabindex()
. I'm submitting a PR with that change in it.Test Code