+
+ ${this.renderBackground?.()}
+ ${this.renderIndicator?.()}
+ ${outline}
+
+
+
+
+
+
+ ${restingLabel}
+ ${outline ? A : floatingLabel}
+
+
+
+
+
+
+
+
+
+
+ ${this.renderSupportingText()}
+
+ `;
+ }
+ updated(changed) {
+ if (changed.has('supportingText') || changed.has('errorText') ||
+ changed.has('count') || changed.has('max')) {
+ this.updateSlottedAriaDescribedBy();
+ }
+ if (this.refreshErrorAlert) {
+ // The past render cycle removed the role="alert" from the error message.
+ // Re-add it after an animation frame to re-announce the error.
+ requestAnimationFrame(() => {
+ this.refreshErrorAlert = false;
+ });
+ }
+ if (this.disableTransitions) {
+ requestAnimationFrame(() => {
+ this.disableTransitions = false;
+ });
+ }
+ }
+ renderSupportingText() {
+ const { supportingOrErrorText, counterText } = this;
+ if (!supportingOrErrorText && !counterText) {
+ return A;
+ }
+ // Always render the supporting text span so that our `space-around`
+ // container puts the counter at the end.
+ const start = x `