Ion-select does not respect required attribute


#1

Hello there,

I’m working on an ionic2 app. and I’m using really basic validation to disable the submit buttons in my forms.

f/e this would work:

<ion-content>
    <form #frm="ngForm">
        <ion-input required>
        <button [disabled]="!frm.valid">
       </form>
< /ion-content>

Replacing the input with a select or radio button however, won’t work (in my code the select would be like this):

        <ion-item>
            <ion-label>some label</ion-label>
            <ion-select required >
                <ion-option *ngFor="#option of selectOptions" value="{{option.id}}">{{option.name}}</ion-option>
            </ion-select>
        </ion-item>

is this;
a - Not supported
b - Not yet supported
c - Incorrectly Implemented by me?


#3

I actually still have this question


#4

I’m having this issue. Any answers?


#5

Not sure right now but I believe I explicitly checked if it’s selected (checking value in component) It sucks but it works


#6

I also have this issue, any news ?


#7

i also facing this issue any updates?


#8

As I replied before I’m still checking the dirty way.

I think it might be useful to look into model driven forms, not sure if that will cover it but I think it will.


#9

Not sure if it is still relevant, but if you add the ngModel attribute the required attribute is handled as expected.


#10

No its not. If you dont select anythig from the list and click ‘Ok’, the selected value still will be empty but required will not be triggered.


#11

Thanks. It works for me


#12

Have you solved this issue?