Closed alelb closed 6 years ago
:+1:
I implemented the declarative part (with a slot fallback) of the use case 1.
The property label
on the chip instance does not exist yet.
Currently this is the behavior.
When the <paper-chip>
contains an HTML element with slot attribute equal to "label" (ie., <div slot="label">content</div>
), its content becomes the visible content of the <paper-chip>
.
Otherwise the <paper-chip>
element fallbacks to use the text content in its light DOM, if any, as the visible content.
This behavior is similar to the <option>
label attribute behavior (ref.).
Also use case 3 works now. :tada:
Use case 1
<paper-chip>xyz-label</paper-chip>
value (property) : undefined label (visual) : xyz-labelUse case 2
<paper-chip value="xyz"></paper-chip>
value (property) : xyz label (visual) : xyzUse case 3
<paper-chip value="xyz">xyz-label</paper-chip>
value (property) : xyz label (visual) : xyz-label