Repository navigation
Closed
Milestone
Description
Short description of the problem:
I have a form with a ion-select element, when trying to submit the form through the submit button work find, however, trying to submit the form with the enter key triggers an error.
What behavior are you expecting?
No errors.
Steps to reproduce:
- Create a form
- Add an ion-input element
- add an ion-select element
- add submit button
- send form with return key.
<form [ngFormModel]="authForm" (ngSubmit)="onSubmit(authForm.value)">
<ion-list padding-vertical class="">
<ion-item>
<ion-input placeholder='{{ "SEARCH_TZADIK_PH" | translate }}' [ngFormControl]="s" type="text"></ion-input>
</ion-item>
<ion-item class="no-border">
<ion-label>{{ "MONTH" | translate }}</ion-label>
<ion-select multiple="true" [ngFormControl]="month">
<ion-option value="{{month?.key}}" *ngFor="#month of months">{{month?.month}}</ion-option>
</ion-select>
</ion-item>
<button full block class="no-margin" type="submit">Find</button>
</ion-list>
</form>
Ionic Version: 2.x
Browser & Operating System: iOS / Android / Chrome
Run ionic info from terminal/cmd prompt:
Cordova CLI: 6.0.0
Gulp version: CLI version 3.9.0
Gulp local:
Ionic Version: 2.0.0-beta.1
Ionic CLI Version: 2.0.0-beta.17
Ionic App Lib Version: 2.0.0-beta.8
ios-deploy version: 1.8.5
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v5.0.0
Xcode version: Xcode 7.2 Build version 7C68
Digging into the code in file ../node_modules/ionic-framework/components/select/select.js
Select.prototype._click = function (ev) {
if(ev.detail == 0){//// adding this 3 lines solves the problem
return;
}
var _this = this;
Sorry but I really don't have very clear how to do a pull request.
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
No fields configured for issues without a type.
Activity
fix(select): do not open on form submit
adamdbradley commentedon Mar 5, 2016
Great find and fix, thanks! I updated it like you said where it won't open up the select if it has detail===0. I also updated it so the select can open by using the spacebar when focused, like a native HTML select element. However, there's still more work to be done to improve it's accessibility. But thanks for reporting the bug!