Code of conduct
Description of issue
We need to add a loading spinner inside the picker's button, which is not supported right now. There is an invalid icon supported and we can extract that logic in a separate method, which can be overridden from outside. This way, the component's API and DOM structure isn't changed, but the consumers gain more flexibility.
What we have now (in render):
${this.invalid
? html`
<sp-icon-alert
class="validation-icon"
></sp-icon-alert>
`
: nothing}
The more flexible version:
protected renderStateIcon(): TemplateResult | typeof nothing {
if (!this.invalid) {
return nothing;
}
return html`
<sp-icon-alert class="validation-icon"></sp-icon-alert>
`;
}
In render:
${this.renderStateIcon()}