Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tigerhawkvok opened this issue Jun 5, 2015 · 1 comment
Closed

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

tigerhawkvok opened this issue Jun 5, 2015 · 1 comment

Comments

@tigerhawkvok
Copy link

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

@notwaldorf
Copy link
Contributor

I don't think tying them together needs to be that complicated. Since cardType is a notify property, you can just do something like:

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

I realize that's a bit annoying, however, so I'll change gold cc-cvc-input to have a cardType property instead of amex, so that you can just write:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants