Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngMaxLength with integer only input fails #7848

Closed

Description

@pocesar

ngMaxlength seem to be coercing the input value to int? I have

<input ng-model="user.data.numero" ng-maxlength="8" type="text">

which user.data.numero = 232, and it's failing. if I type "n232" it works. Using latest 1.3.0 beta 12

Activity

  1. Narretz commented on Jun 16, 2014

    @Narretz
    Contributor

    Hm, in this plunker, $error.maxlength becomes true if I have more than 8 characters in the input:

    http://plnkr.co/edit/od2qLXAncyy73FAdqlng?p=preview

    So this works. Are your refering to a specific behavior? (In beta.12, the behavior changed insofar that invalid model values will show in the bound input regardless of validity.)

  2. matsko commented on Jun 16, 2014

    @matsko
    Contributor

    @Narretz you mean that when the validity is failing then the model value will not show up at all.

    http://plnkr.co/edit/it2bJvUwaT3VAy2idGQS?p=preview

  3. added this to the 1.3.0-beta.13 milestone on Jun 16, 2014
  4. self-assigned this
    on Jun 16, 2014
  5. Narretz commented on Jun 16, 2014

    @Narretz
    Contributor

    @matsko that has always been the case, iirc. The other way round is new (invalid model shows in input). Might actually be a breaking change if you think about it.

  6. matsko commented on Jun 16, 2014

    @matsko
    Contributor

    Yes it could be overly strict. I think we need another property on ngModel that is there no matter what: #6740 (comment)

  7. 10 remaining items

  8. tbosch commented on Aug 4, 2014

    @tbosch
    Contributor

    Might be fixed via #7968 though...

  9. caitp commented on Aug 4, 2014

    @caitp
    Contributor

    That PR should fix it, but it's a good point that it doesn't really make sense for numbers, in general, but it might be good to support for url/email.

  10. matsko commented on Aug 4, 2014

    @matsko
    Contributor

    The bug is fixed when tested on master: http://plnkr.co/edit/0HKYThxJWZIoHvQIgaol?p=preview

  11. caitp commented on Aug 4, 2014

    @caitp
    Contributor

    the bug is still happening there with the snapshot script, @matsko

  12. matsko commented on Aug 4, 2014

    @matsko
    Contributor

    Sorry, my mistake, I though that we were paying attention to the error and not the model value.

  13. caitp commented on Aug 8, 2014

    @caitp
    Contributor

    well, there's a fix for this but I haven't heard any comments about it =( moving this to the next milestoneeeeee

  14. modified the milestones: 1.3.0-beta.19, on Aug 18, 2014
  15. changed the title [-]ngMaxLength with integer only input fails[/-] [+]ngMaxLength on type="text" with integer only input fails[/+] on Aug 28, 2014
  16. changed the title [-]ngMaxLength on type="text" with integer only input fails[/-] [+]ngMaxLength with integer only input fails[/+] on Aug 28, 2014
  17. Narretz commented on Sep 24, 2014

    @Narretz
    Contributor

    As far as I can see the bug in http://plnkr.co/edit/FPYKrOrTrWKf6PnoaYro?p=preview is fixed in the current snapshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions