Closed cwpeng closed 2 years ago
This problem is caused by the component key set timing.
We set the key on connectedCallback
, i.e. when the component was added to DOM. Then for some reason (probably for reducing the times update event being triggered,) we skipped attribute update by checking if the key is not valid (unset.)
That's why in this case of creating component programically -- create and set attributes/properties first, and add to DOM later -- the properties are well set, but the attributes take no effect.
By changing the key set timing from connectedCallback
to right after init
function being called, this issue is solved. But we shall still take a look if it makes any further side effect.
@cwpeng Please take a review.
Done.
If we use code below to create w-button, type and size attributes do not work.