<!-- Label and Label Position --> <!-- Before --> <ion-item> <ion-labelposition="floating">Email:</ion-label> <ion-input></ion-input> </ion-item> <!-- After --> <ion-item> <ion-inputlabel="Email:"label-placement="floating"></ion-input> </ion-item> <!-- Fill --> <!-- Before --> <ion-itemfill="outline"shape="round"> <ion-labelposition="floating">Email:</ion-label> <ion-input></ion-input> </ion-item> <!-- After --> <!-- Inputs using `fill` should not be placed in ion-item --> <ion-inputfill="outline"shape="round"label="Email:"label-placement="floating"></ion-input> <!-- Input-specific features on ion-item --> <!-- Before --> <ion-itemcounter="true"> <ion-labelposition="floating">Email:</ion-label> <ion-inputmaxlength="100"></ion-input> <divslot="helper">Enter an email</div> <divslot="error">Please enter a valid email</div> </ion-item> <!-- After --> <!-- Metadata such as counters and helper text should not be used when an input is in an item/list. If you need to provide more context on a input, consider using an ion-note underneath the ion-list. --> <ion-input label="Email:" counter="true" maxlength="100" helper-text="Enter an email" error-text="Please enter a valid email" ></ion-input>
<!-- Label and Label Position --> <!-- Before --> <ion-item> <ion-labelposition="floating">Email:</ion-label> <ion-input></ion-input> </ion-item> <!-- After --> <ion-item> <ion-inputlabel="Email:"labelPlacement="floating"></ion-input> </ion-item> <!-- Fill --> <!-- Before --> <ion-itemfill="outline"shape="round"> <ion-labelposition="floating">Email:</ion-label> <ion-input></ion-input> </ion-item> <!-- After --> <!-- Inputs using `fill` should not be placed in ion-item --> <ion-inputfill="outline"shape="round"label="Email:"labelPlacement="floating"></ion-input> <!-- Input-specific features on ion-item --> <!-- Before --> <ion-item[counter]="true"> <ion-labelposition="floating">Email:</ion-label> <ion-inputmaxlength="100"></ion-input> <divslot="helper">Enter an email</div> <divslot="error">Please enter a valid email</div> </ion-item> <!-- After --> <!-- Metadata such as counters and helper text should not be used when an input is in an item/list. If you need to provide more context on a input, consider using an ion-note underneath the ion-list. --> <ion-input label="Email:" [counter]="true" maxlength="100" helperText="Enter an email" errorText="Please enter a valid email" ></ion-input>
{/* Label and Label Position */} {/* Before */} <IonItem> <IonLabelposition="floating">Email:</IonLabel> <IonInput></IonInput> </IonItem> {/* After */} <IonItem> <IonInputlabel="Email:"labelPlacement="floating"></IonInput> </IonItem> {/* Fill */} {/* Before */} <IonItemfill="outline"shape="round"> <IonLabelposition="floating">Email:</IonLabel> <IonInput></IonInput> </IonItem> {/* After */} {/* Inputs using `fill` should not be placed in IonItem */} <IonInputfill="outline"shape="round"label="Email:"labelPlacement="floating"></IonInput> {/* Input-specific features on IonItem */} {/* Before */} <IonItemcounter={true}> <IonLabelposition="floating">Email:</IonLabel> <IonInputmaxlength="100"></IonInput> <divslot="helper">Enter an email</div> <divslot="error">Please enter a valid email</div> </IonItem> {/* After */} {/* Metadata such as counters and helper text should not be used when an input is in an item/list. If you need to provide more context on a input, consider using an IonNote underneath the IonList. */} <IonInput label="Email:" counter={true} maxlength="100" helperText="Enter an email" errorText="Please enter a valid email" ></IonInput>
<!-- Label and Label Position --> <!-- Before --> <ion-item> <ion-labelposition="floating">Email:</ion-label> <ion-input></ion-input> </ion-item> <!-- After --> <ion-item> <ion-inputlabel="Email:"label-placement="floating"></ion-input> </ion-item> <!-- Fill --> <!-- Before --> <ion-itemfill="outline"shape="round"> <ion-labelposition="floating">Email:</ion-label> <ion-input></ion-input> </ion-item> <!-- After --> <!-- Inputs using `fill` should not be placed in ion-item --> <ion-inputfill="outline"shape="round"label="Email:"label-placement="floating"></ion-input> <!-- Input-specific features on ion-item --> <!-- Before --> <ion-item:counter="true"> <ion-labelposition="floating">Email:</ion-label> <ion-inputmaxlength="100"></ion-input> <divslot="helper">Enter an email</div> <divslot="error">Please enter a valid email</div> </ion-item> <!-- After --> <!-- Metadata such as counters and helper text should not be used when an input is in an item/list. If you need to provide more context on a input, consider using an ion-note underneath the ion-list. --> <ion-input label="Email:" :counter="true" maxlength="100" helper-text="Enter an email" error-text="Please enter a valid email" ></ion-input>
The ionChange event is fired when the user modifies the input's value. Unlike the ionInput event, the ionChange event is only fired when changes are committed, not as the user types.
Depending on the way the users interacts with the element, the ionChange event fires at a different moment: - When the user commits the change explicitly (e.g. by selecting a date from a date picker for <ion-input type="date">, pressing the "Enter" key, etc.). - When the element loses focus after its value has changed: for elements where the user's interaction is typing.
ionFocus
Inputにフォーカスが当たったときに発行されます。
ionInput
The ionInput event is fired each time the user modifies the input's value. Unlike the ionChange event, the ionInput event is fired for each alteration to the input's value. This typically happens for each keystroke as the user types.
For elements that accept text input (type=text, type=tel, etc.), the interface is InputEvent; for others, the interface is Event. If the input is cleared on edit, the type is null.