Giter VIP home page Giter VIP logo

Comments (3)

chinedufn avatar chinedufn commented on June 1, 2024

The maxlength attribute IS being set to two (or 4). The issue is that maxlength affects type="string" but not type="number".

Options:

  1. Set max="99", min="0" - This is more type="number" friendly. It would still allow for floats (3.1617 would be valid), so the value would need to be rounded on update.
  2. Change Readme to reflect that one may use type="text" but not type="number" - Quick fix.. But should be avoided since all input will be numeric

from angular-credit-cards.

bendrucker avatar bendrucker commented on June 1, 2024

This is going to be a docs fix. Unless there's a priority issue the validation key should still be set with type="number" because maxlength handling checks the length of the view value (always a string):

https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L2698-L2716

I'll confirm this via a test though. I'm not willing to make the extra effort to reproduce the browser's maxlength behavior (preventing entry and slicing pastes after n characters) for type="number" since creditcards is already going to parse the number properly anyway.

from angular-credit-cards.

bendrucker avatar bendrucker commented on June 1, 2024

Thanks!

from angular-credit-cards.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.