Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ion-select activated on enter in input field #12202

Closed
peterssonanton opened this issue Jun 29, 2017 · 5 comments
Closed

Ion-select activated on enter in input field #12202

peterssonanton opened this issue Jun 29, 2017 · 5 comments

Comments

@peterssonanton
Copy link

peterssonanton commented Jun 29, 2017

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


@jgw96
Copy link
Contributor

jgw96 commented Jun 29, 2017

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!

@peterssonanton
Copy link
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.

@anthonyhoarau
Copy link

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.

@japostigo-KMM
Copy link

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.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 1, 2018

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants