MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / renderLabelContainer

Method renderLabelContainer

core/src/components/input/input.tsx:814–850  ·  view source on GitHub ↗

* Renders the border container * when fill="outline".

()

Source from the content-addressed store, hash-verified

812 * when fill="outline".
813 */
814 private renderLabelContainer() {
815 const mode = getIonMode(this);
816 const hasOutlineFill = mode === 'md' && this.fill === 'outline';
817
818 if (hasOutlineFill) {
819 /**
820 * The outline fill has a special outline
821 * that appears around the input and the label.
822 * Certain stacked and floating label placements cause the
823 * label to translate up and create a "cut out"
824 * inside of that border by using the notch-spacer element.
825 */
826 return [
827 <div class="input-outline-container">
828 <div class="input-outline-start"></div>
829 <div
830 class={{
831 'input-outline-notch': true,
832 'input-outline-notch-hidden': !this.hasLabel,
833 }}
834 >
835 <div class="notch-spacer" aria-hidden="true" ref={(el) => (this.notchSpacerEl = el)}>
836 {this.label}
837 </div>
838 </div>
839 <div class="input-outline-end"></div>
840 </div>,
841 this.renderLabel(),
842 ];
843 }
844
845 /**
846 * If not using the outline style,
847 * we can render just the label.
848 */
849 return this.renderLabel();
850 }
851
852 render() {
853 const { disabled, fill, readonly, shape, inputId, labelPlacement, el, hasFocus, clearInputIcon } = this;

Callers 1

renderMethod · 0.95

Calls 2

renderLabelMethod · 0.95
getIonModeFunction · 0.90

Tested by

no test coverage detected