-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Closed
Labels
package: core@ionic/core package@ionic/core packagetype: buga confirmed bug reporta confirmed bug report
Description
Bug Report
Ionic version:
[x] 4.11.4
Current behavior:
When setting an ion-input's value to a trimmed version of its previous value, the input does not recognize the value change. Therefore, there is no way to enforce input value trimming while typing inside an ion-input or after leaving an ion-input.
Expected behavior:
Setting the value of an ion-input should accept any string and update accordingly.
Steps to reproduce:
- Initialize an ion-input on the page.
- Listen to the ionInput event.
- Inside the inputInput event, set the input's value to a trimmed version of its own value.
Related code:
JS FIDDLE: https://jsfiddle.net/kpe14jwz/3/
<ion-item>
<ion-label position="floating">Type here</ion-label>
<ion-input id="ionInput"></ion-input>
</ion-item>document.getElementById('ionInput')
.addEventListener('ionInput', (e) => {
e.target.value = e.target.value.trim();
});Ionic Info:
N/A. Working out of jsfiddle with CDN.
SepehrSepahi
Metadata
Metadata
Assignees
Labels
package: core@ionic/core package@ionic/core packagetype: buga confirmed bug reporta confirmed bug report