Giter Club home page Giter Club logo

gold-cc-cvc-input's People

Contributors

87victorhugo avatar aomarks avatar beckysiegel avatar bicknellr avatar dfreedm avatar e111077 avatar garlicnation avatar gurpreetatwal avatar h3dz avatar jakemac53 avatar notwaldorf avatar phillipsenn avatar rictic avatar samuelli avatar srikkbhat avatar tedium-bot avatar tjsavage avatar tyriar avatar would-code-again avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gold-cc-cvc-input's Issues

Validation state of this and other gold-* inputs cannot be reset

Description

I have multiple inputs in a form, paper-* and gold-*. All of them have "auto-validate" and "required".

<paper-input id="name" auto-validate required></paper-input>
<gold-phone-input id="cc" auto-validate required></gold-phone-input>
<gold-cc-cvc-input id="cvc"  auto-validate required></gold-cc-cvc-input>

Field becomes "invalid" and highlighted with red when:
a) user clicks some input and then clicks another ("blur" happens) without typing any value
b) user enters some value which is invalid (phone, cvc)

If user just clicked and entered nothing - I want to reset this form later - to set "invalid" to false for all empty inputs. But for paper-inputs it works, for gold-inputs - does not. When I do this:

   this.$.name.invalid = false;
   this.$.phone.invalid = false;
   this.$.cvc.invalid = false;

paper input validation is reset, but gold-* inputs are still highlighted with red (they're empty).

This inconsistency makes our interface look weird. Especially in address forms, where some inputs are paper-* (name, address, ..) and some are gold-* (phone, cc, cvc, zip). I cannot reset form back to initial non-validated status.

Expectations

I'd expect this logic: if gold-* input value is empty, and developer sets "invalid" to "false" - set paper-input-container.invalid to false so that validation is reset.

Here's jsbin
https://jsbin.com/zazuyi/edit?html,output

Should auto-bind to cardType on gold-cc-input

Why do devs have to touch this at all? It's already a custom element, why not have the smarts built in?

Proposed behaviour:

  1. Give it a for attribute, which takes a selector for a <gold-cc-input> element.
  2. If that's not there, and if the parent <form>, <iron-form>, or non-<form> first parent also has a single <gold-cc-input> as a child, then bind to that
  3. Otherwise devs are left with the current behaviour

It should, practically, also solve #18 (as it's very rare for a user to enter the CVC before the card number).

Doesn't accept numpad entry

(Issue based off Polymer website demo at time of entry)

gold-cc-cvc-input does not accept numbers typed via the numpad as valid.

gold-cc-cvc-input img.src paths are relative to document url

The img elements in gold-cc-cvc-input have relative src urls (eg src='cvc_hint.png'). This causes the images to be requested relative to the document path, not the component's source path; so the image requests will fail... Eg:

Page at /mypath has a gold-cc-cvc-input element. The img elements within gold-cc-cvc-input request their images with relative paths, so 'cvc_hint.png' is requested at /mypath/cvc_hint.png instead of something like /mypath/bower_components/gold-cc-cvc-input/cvc_hint.png.

Am I doing something wrong? or should the img src attributes be fixed?
Maybe <img src="cvc_hint.png" ...> could be changed to <img src="[[resolveUrl('cvc_hint.png')]]" ...> or something like that?

polymer 2.0.0
gold-cc-cvc-input 2.0-preview

Looks like the same problem is mentioned here: #54

Number of digits allowed by default

When we have these two inputs on the page

<gold-cc-input auto-validate card-type="{{cardType}}"></gold-cc-input>
<gold-cc-cvc-input card-type="[[cardType]]"></gold-cc-cvc-input>

user sometimes wants to start typing from second one. But that allows only 3 digits by default (when cardType is unknown). Maybe it makes sense to allow both 3 and 4 symbols when cardType is undefined yet?

gold-cc-cvc-input accessibility issues

Contrast: Please make the CVC text a bit darker so the contrast is improved.

Also, I'm not able to trigger the custom error message. When this does show, is it an announcement so the user can hear what the error is with spoken feedback?

Audit results:
[Severe] Controls and media elements should have labels (4)
[Warning] Images should have an alt attribute (4)
[Warning] Text elements should have a reasonable contrast ratio (1)
Not applicable tests (7)
Passing tests (5)

CVC Icon does not becomes hidden on chrome when using shadow dom

Description

The gold-cc-cvc-input icon does not become hidden when using shadow-dom on chrome.

Expected outcome

Example: Just one icon appear (Microsoft edge example).

image

Actual outcome

Example: Both icons appear.

image

Steps to reproduce

  1. Put a gold-cc-cvc-input element in the page.
  2. Turn on the shadow-dom flag:
    <script>
     /* this script must run before Polymer is imported */
    window.Polymer = {
      dom : 'shadow',
      lazyRegister: true
    };
    </script>
  1. Open the page in a web browser.

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10

Invalid property is only true when user has introduced and deleted input

Description

Invalid property is only true when user has introduced and deleted input

Expected outcome

I would expect that invalid property is always true unless the user introduces a complete cvc number

Actual outcome

Invalid is only true when cvc value is empty, but false otherwise

Live Demo

https://jsbin.com/goxarew/edit?html,output

Steps to reproduce

  1. Put a gold-cc-cvc-input element in the page.
  2. Introduce value 7
  3. invalid is false. (IMO it should be true!)
  4. Delete input
  5. invalid is true

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10

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.