* Responsible for rendering helper text, * error text, and counter. This element should only * be rendered if hint text is set or counter is enabled.
()
| 706 | * be rendered if hint text is set or counter is enabled. |
| 707 | */ |
| 708 | private renderBottomContent() { |
| 709 | const { counter, helperText, errorText, maxlength } = this; |
| 710 | |
| 711 | /** |
| 712 | * undefined and empty string values should |
| 713 | * be treated as not having helper/error text. |
| 714 | */ |
| 715 | const hasHintText = !!helperText || !!errorText; |
| 716 | const hasCounter = counter === true && maxlength !== undefined; |
| 717 | if (!hasHintText && !hasCounter) { |
| 718 | return; |
| 719 | } |
| 720 | |
| 721 | return ( |
| 722 | <div class="input-bottom"> |
| 723 | {this.renderHintText()} |
| 724 | {this.renderCounter()} |
| 725 | </div> |
| 726 | ); |
| 727 | } |
| 728 | |
| 729 | private renderLabel() { |
| 730 | const { label, labelTextId } = this; |
no test coverage detected