Skip to content

bug: ion-input ignores min value for validation #18240

Closed

Description

@swavans

Bug Report

Ionic version:
[x] 4.x

Current behavior:
When an ion-input is defined with either min or max values specified

Expected behavior:
I expect the validation to fail when the user is below min or above max, and therefor the parent ion-item to show a red border on the bottom.

Steps to reproduce:
Create an ion-input inside an ion-item in a template driven form.

Related code:
https://stackblitz.com/edit/ionic-6pxtfl
(pattern is added to show expected validation behaviour)

Activity

  1. liamdebeasi commented on May 10, 2019

    @liamdebeasi
    Contributor

    Hi there,

    Thanks for the issue. I noticed the StackBlitz references Ionic 3 (I see ionic-angular: 3.9.2 in your package.json). Is this issue happening with an Ionic 3 app, or an Ionic 4 app?

    Thanks!

  2. added
    needs: reply
    on May 10, 2019
  3. swavans commented on May 13, 2019

    @swavans
    Author

    Woeps my bad
    It's supposed to be Ionic 4, but if it also happens in the stack blitz than I guess it's in both.

  4. added and removed
    needs: reply
    on May 13, 2019
  5. liamdebeasi commented on May 15, 2019

    @liamdebeasi
    Contributor

    Thanks for the follow up. Can you post a repo with the code required to reproduce this issue running inside an Ionic 4 application?

    Thanks!

  6. added
    needs: reply
    on May 15, 2019
  7. added and removed
    needs: reply
    on May 16, 2019
  8. liamdebeasi commented on May 16, 2019

    @liamdebeasi
    Contributor

    Hi there,

    Thanks for the follow up. Angular handles the form validation, and currently min/max is not supported using template-driven forms: angular/angular#16352.

    I would recommend using reactive form validation for now if you need this support: https://angular.io/guide/form-validation#reactive-form-validation.

    I am going to close this as this is not an Ionic issue. Thanks!

  9. ionitron-bot commented on Jun 15, 2019

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

  10. locked and limited conversation to collaborators on Jun 15, 2019
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

    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