Skip to content

Ion-select activated on enter in input field #12202

Closed

Description

@peterssonanton

Ionic version: 3.x

I'm submitting a ... bug report

Current behavior:

An ion-select element is activated when hitting the enter key while in an ion-input field on the same page. It seems to be the same issue as this that was fixed but has appeared again:
#5596

Expected behavior:

It should not open.

Steps to reproduce:

Have an ion-select an ion-input element on the same page.
Enter something in the input field.
When hitting enter (or Go/Submit on devices), the select window is activated as if you clicked the element.
Related code:

<ion-item >
  <ion-label>Select one:</ion-label>
  <ion-select>
    <ion-option>Option 1</ion-option>
    <ion-option>Option 2</ion-option>
    <ion-option>Option 3</ion-option>
    <ion-option>Option 4</ion-option>
  </ion-select>
</ion-item>
<ion-item>
  <ion-label>Input:</ion-label>
    <ion-input type="text"></ion-input>
</ion-item>

Other information:

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

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 6.5.0
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.1.2
    Ionic Framework                 : ionic-angular 3.5.0

System:

    Node       : v6.11.0
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 4.1.2


Activity

  1. jgw96 commented on Jun 29, 2017

    @jgw96
    Contributor

    Hello @peterssonanton , mind sharing a minimal repo we can use to reproduce this issue? I am not able to reproduce this on my Nexus 6 running Android 7.1.1. Thanks!

  2. peterssonanton commented on Jun 30, 2017

    @peterssonanton
    Author

    Hi @jgw96 ,
    I used the ionic components preview app to demonstrate the issue: https://github.com/peterssonanton/example
    I can reproduce it both in the browser and on device.

  3. anthonyhoarau commented on Jun 30, 2017

    @anthonyhoarau

    Hi,
    I have the same issue in my project with :

    <form>
        <ion-list>
            <ion-item>
                <ion-label>AnyLabel</ion-label>
                <ion-select>[...]</ion-select>
            </ion-item>
            <ion-item>
                <ion-label>AnyInput</ion-label>
                <ion-input>[...]</ion-input>
            </ion-item>
            <ion-item>
                <button ion-button type="submit">MySubmitButton</button>
            </ion-item>
        </ion-list>
    </form>
    

    And when i press enter key on desktop or mobile in the ion-input, the select window is activated.

  4. japostigo-km commented on Nov 30, 2017

    @japostigo-km

    Still reproducing the same issue. I had fixed it putting an invisible button at the top of the form, so that button is triggered instead of the ion-select when enter key is pressed.

  5. 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.

  6. 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