Skip to content

clearInput doesn't seem to work on IOS #10393

Closed

Description

@bmagni

Ionic version: (check one with "x")
[ ] 1.x
[x] 2.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
I want to add clearInput attribute on my ion-inputs. My ion-inputs have ngModel attributes and some have keyup functions bind to them. On IOS, the clearInput icon shows up on focus but nothing happends when clicking it besides the loss of focus on the ion-input. It does work on Android.

Expected behavior:
I expect inputs to be empty after clicking on the clearInput icon.

Steps to reproduce:

Related code:

<ion-item>
	<ion-input [(ngModel)]="lastName" clearInput></ion-input>
</ion-item>

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.1
ios-sim version: Not installed
OS: OS X El Capitan
Node Version: v7.0.0
Xcode version: Xcode 8.2 Build version 8C38

Activity

  1. changed the title [-]clearInput doesn't work on IOS[/-] [+]clearInput doesn't seem to work on IOS[/+] on Feb 10, 2017
  2. jgw96 commented on Feb 10, 2017

    @jgw96
    Contributor

    Hello, thanks for using Ionic! We will look into this.

  3. pinpointpanda commented on Feb 14, 2017

    @pinpointpanda

    @bmagni thanks for raising this, you beat me to it!

    I'm experiencing the same issue, although I'm binding slightly differently using a FormGroup instead of ngModel.

  4. dalemugford commented on Feb 16, 2017

    @dalemugford

    Same issue, noticed it a few days ago. Have had to disable that feature in app.

  5. Killmore commented on May 12, 2017

    @Killmore

    I was noticing the same issue. After playing around with it I started to notice it would work on some occasions. I think it's due to the 'hitbox' area of the clear button is very small on ios. On rare instances I could click it just right and get the expected behavior but the majority of the time it would just close the keyboard and retain the text. Just an assumption...

  6. elvandar06 commented on May 18, 2017

    @elvandar06

    I face the same problem, but on desktop, and with an input of type "date" :
    the hitbox of the clear button is so tiny that it becomes unusable.
    The other input types work well.

  7. davibertolini commented on May 22, 2017

    @davibertolini

    Same issue here, changed to clearInput="true" and works on browser (ionic serve) but not on device. When tapping on the clear button, it just looses focus and closes the keyboard, but won't clear the text...

    global packages:

    @ionic/cli-utils : 1.0.0
    Cordova CLI      : 6.5.0 
    Ionic CLI        : 3.0.0
    

    local packages:

    @ionic/app-scripts              : 1.3.4
    @ionic/cli-plugin-cordova       : 1.0.0
    @ionic/cli-plugin-ionic-angular : 1.0.0
    Ionic Framework                 : ionic-angular 3.1.0
    

    System:

    Node       : v7.4.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.2 Build version 8E2002 
    ios-deploy : 1.9.0 
    ios-sim    : 5.0.8 
    
  8. jasonfairhead commented on May 24, 2017

    @jasonfairhead

    Same issue. any update @jgw96 ?

  9. flyhuang commented on Jun 7, 2017

    @flyhuang

    Same issue.

    I change "click" to "tap" in ionic/src/components/input/input.ts

    '<button ion-button clear [hidden]="!clearInput" type="button" class="text-input-clear-icon" (click)="clearTextInput()" (mousedown)="clearTextInput()"></button>'

    It works fine.

  10. jasonfairhead commented on Jun 9, 2017

    @jasonfairhead

    @flyhuang thanks!

  11. added 2 commits that reference this issue on Jun 12, 2017
    574ee31
    c10f72b
  12. jasonfairhead commented on Dec 22, 2017

    @jasonfairhead

    anyone notice that if using --prod to build this fix no longer works?

  13. ionitron-bot commented on Sep 1, 2018

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  14. locked and limited conversation to collaborators on Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions