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
On ready(), set the active attribute of the <paper-button> in the slot to true.
Create a parent element that holds the child element and inserts a <paper-button> into the slot.
Browsers Affected
Chrome
Firefox
Safari 9
Safari 8
Safari 7
Edge
IE 11
IE 10
The text was updated successfully, but these errors were encountered:
eriklumme
changed the title
Setting the active attribute of a paper-button inserted into a slot using setAttribute requires calling it twice before it is updated.
Setting the active attribute of a paper-button inserted into a slot using setAttribute requires calling it twice before it is updated.
Aug 24, 2017
This seems to be the case with other properties such as raised too, but not properties not defined in the paper-button such as my-attribute.
Instead of setting active twice, one can set raised once and then active, at which point raised will be false and active will be true. I.e. the first time any property defined in paper-button is set, it is not updated. After that, all properties are immediately updated.
That happens because these properties do reflectToAttribute and have a default value, e.g. see active property.
I'd suggest to set the property instead of the attribute, e.g.
Description
Imperatively setting the
active
attribute of apaper-button
inserted into a slot requires setting it twice before it is updated.Expected outcome
The attribute is updated the first time.
Actual outcome
The attribute is not updated until the second time.
Live Demo
https://jsbin.com/lalarivoli/1/edit?html,console,output
Steps to reproduce
ready()
, set theactive
attribute of the<paper-button>
in the slot to true.<paper-button>
into the slot.Browsers Affected
The text was updated successfully, but these errors were encountered: