# Ion-input type number becomes unresponsive when holding down the delete key on device

**URL:** <https://forum.ionicframework.com/t/ion-input-type-number-becomes-unresponsive-when-holding-down-the-delete-key-on-device/225656>\
**Category:** Ionic Framework\
**Created:** [August 3, 2022, 7:02pm UTC](https://forum.ionicframework.com/t/ion-input-type-number-becomes-unresponsive-when-holding-down-the-delete-key-on-device/225656 "2022-08-03T19:02:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![citerio](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/citerio/32/109191_2.png) [@citerio](https://forum.ionicframework.com/u/citerio)\
**Post date:** [August 3, 2022, 7:02pm UTC](https://forum.ionicframework.com/t/ion-input-type-number-becomes-unresponsive-when-holding-down-the-delete-key-on-device/225656/1 "2022-08-03T19:02:45Z")

</div>

I’m having an issue with an ion-input, which drops this error below when holding down the delete key.

```auto
"Error: Invalid argument '' for pipe 't'
    at new Error (native)
    at Error.v (file:///android_asset/www/build/polyfills.js:3:4864)
    at e [as constructor] (file:///android_asset/www/build/main.js:94:11171)
    at new e (file:///android_asset/www/build/main.js:14:10469)
    at n (file:///android_asset/www/build/main.js:9:10302)
    at t.transform (file:///android_asset/www/build/main.js:9:11000)
    at file:///android_asset/www/build/main.js:1:17764
    at e.detectChangesInternal (file:///android_asset/www/build/main.js:125:10032)
    at e.t.detectChanges (file:///android_asset/www/build/main.js:4:8847)
    at e.t.internalDetectChanges (file:///android_asset/www/build/main.js:4:8640)
    at e.detectChangesInternal (file:///android_asset/www/build/main.js:120:27362)
    at e.t.detectChanges (file:///android_asset/www/build/main.js:4:8847)
    at t.detectChangesInNestedViews (file:///android_asset/www/build/main.js:4:28534)
    at e.detectChangesInternal (file:///android_asset/www/build/main.js:80:24234)
    at e.t.detectChanges (file:///android_asset/www/build/main.js:4:8847)", source: 
    file:///android_asset/www/build/main.js (29)
     

This one below is my ion-input:

<ion-input color="primary_light" [(ngModel)]="montco_ui" type="number 
    (keyup)="formataNumero()"></ion-input>

```

Also, I’m using this algorithm to handle 2 decimal places, which is working fine, since I guess the issue is related to the type number property on the ion-input.

```auto
formataNumero(separador: string = '.', decimais: number = 2) {
    console.log('formataNumero called');
    let a: any = this.montco_ui.split('');
    let ns: string = '';
    a.forEach((c: any) => { if (!isNaN(c)) ns = ns + c; });
    ns = parseInt(ns).toString();
    if (ns.length < (decimais + 1)) { 
        ns = ('0'.repeat(decimais + 1) + ns); 
        ns = ns.slice((decimais + 1) * -1); 
    }
    let ans = ns.split('');
    let r = '';
    for (let i = 0; i < ans.length; i++) 
        if (i == ans.length - decimais) {
          r = r + separador + ans[i]; else r = r + ans[i];
        }
         
    this.montco_ui = r;
}

```

Finally, this is the variable that keeps the value:

```auto
public montco_ui: string = "0.00";

P.S.: I'm using Ionic 2 for my project.
```
