Skip to content

form validation border on ion-items with select inputs (ion-select) #12345

Closed

Description

@cyptus

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[x] 3.x

I'm submitting a ... (check one with "x")
[ ] bug report
[x] 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:

ion-items with text text inputs gets the class "item-input" and a validation border (e.g. $text-input-ios-show-invalid-highlight) if it is invalid (for example required).
ion-items with select inputs does not get this validation border if they are required (css class item-select on ion-item).

Expected behavior:

While select-inputs can have a required input, the validation borders should been visible on ion-items with select inputs too.

Steps to reproduce:

Related code:

<form [formGroup]="personForm">
  <ion-list>
    <ion-item> <!-- shows a validation border -->
      <ion-label color="primary">Name</ion-label>
      <ion-input type="text" placeholder="Name" formControlName="username"></ion-input>
    </ion-item>

    <ion-item> <!-- does not show a validation border -->
      <ion-label color="primary">Gender</ion-label>
      <ion-select interface="popover" formControlName="gender">
        <ion-option value="1" selected="true">Male</ion-option>
        <ion-option value="2">Female</ion-option>
      </ion-select>
    </ion-item>
  </ion-list>
</form>
    this.personForm = formBuilder.group({
      username: ['', Validators.required],
      gender: ['', Validators.required],
    });

Other information:

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

insert the output from ionic info here

global packages:

@ionic/cli-utils : 1.5.0
Cordova CLI      : 7.0.1
Ionic CLI        : 3.5.0

local packages:

@ionic/app-scripts              : 1.3.12
@ionic/cli-plugin-cordova       : 1.4.1
@ionic/cli-plugin-ionic-angular : 1.3.2
Cordova Platforms               : android 6.2.3 ios 4.4.0
Ionic Framework                 : ionic-angular 3.4.2

System:

Node       : v6.10.0
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 3.10.10

Activity

  1. bArraxas commented on Aug 28, 2017

    @bArraxas

    The same problem exist for <ion-datetime>
    Here my personal fixe :

    <ion-item [ngClass]="{ 'ng-valid': myDate !== null, 'item-input': true }">
      <ion-datetime [(ngModel)]="myDate " displayFormat="DD/MM/YYYY" pickerFormat="DD/MM/YYYY" [min]="min" [max]="max" placeholder="a placeholder..."></ion-datetime>
    </ion-item>
    
  2. kensodemann commented on Aug 28, 2017

    @kensodemann
    Contributor

    Hello everyone! Thank you for the feature request. I'm going to move this issue over to our internal list of feature requests for evaluation. We are continually prioritizing all requests that we receive with outstanding issues. We are extremely grateful for your feedback, but it may not always be our next priority. I'll copy the issue back to this repository when we have begun implementation. Thanks!

  3. kensodemann commented on Aug 28, 2017

    @kensodemann
    Contributor

    This issue was moved to ionic-team/ionic-feature-requests#304

  4. bArraxas commented on Aug 29, 2017

    @bArraxas

    404 not found

  5. kensodemann commented on Aug 29, 2017

    @kensodemann
    Contributor

    It is a private repo.

  6. JeongJun-Lee commented on Jul 19, 2018

    @JeongJun-Lee

    Is this issue solved? because I've still met this issue at Ionic 3.9.x.

  7. AntonTrapp commented on Jul 20, 2018

    @AntonTrapp

    No idea, sorry, not using ionic any more.

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

  9. locked and limited conversation to collaborators on Sep 1, 2018
  10. added a commit that references this issue on Apr 17, 2023
    c9bddbd
  11. added a commit that references this issue on Apr 19, 2023
    54bec4d
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