New issue
Advanced search Search tips

Issue 671762 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

In the Payment Request unmask prompt, focus should go to the next field when one is complete

Project Member Reported by se...@chromium.org, Dec 6 2016

Issue description

More specifically, the focus should go to the year field once the month field has two characters filled and the focus should go to the cvc field when the year field has two characters.
 

Comment 1 by se...@chromium.org, Dec 6 2016

Cc: rouslan@chromium.org
Hi Rouslan WDYT?
unmask_focus_change.mp4
1.6 MB View Download
Focus should move only if input is valid.

Comment 3 by se...@chromium.org, Dec 6 2016

Ok so something like:

If month is filled but year is empty, move to year.
If both month and year are filled but wrong, stay at current field.
If both month and year are filled and valid, move to CVC.

?
Pretty much. Here's how I would phrase it:

* After the value in month field changed, if it's a number from 1 to 12, move to year field. Otherwise show month error.

* After the value in year field changed, if it's a number from 00 to 99 and at least as large as current year, move focus to cvc. Otherwise show year error. You may want to check that the date is in the future as well.

Triggering this logic is on field change event is important for usability. There's no need to define behavior for staying at the current field. That's what happens by default. I don't see the point of checking whether the year field is empty before moving focus there. Do you?

Comment 5 by se...@chromium.org, Dec 6 2016

Not sure about point 1. 

For example, I could want to input 11 in the month field, and I would not want the focus to move to year after typing 1. So I would only change to year if there a two digits?

I would have thought to not move the focus from year if the expiration date is not valid. For example, if I enter 06/16. even though the year could be valid, I would not switch to cvc?

You are right, I would not implement behavior for staying at the current field :P My point for checking the year field is related to my second point above. If the exp is invalid and both fields have "values" I would not move focus. However. If only month has been filled, then it makes sense to move to year.

WDYT?


> For example, I could want to input 11 in the month field, and I would not want the focus to move to year after typing 1. So I would only change to year if there a two digits?

Good point, move focus only if two digits are typed in, so 01 instead of 1.

> I would have thought to not move the focus from year if the expiration date is not valid. For example, if I enter 06/16. even though the year could be valid, I would not switch to cvc?

Yep. Show an error instead at this point.

Comment 7 by se...@chromium.org, Dec 7 2016

Hi Rouslan, here is the new demo. I also added error messages for the month and year fields. WDYT?
new_errors_and_focus_change.mp4
2.3 MB View Download
After you've cleared the month field, the error should go away, right? Otherwise looks good.

Comment 9 by se...@chromium.org, Dec 8 2016

New video
focus_and_errors.mp4
2.3 MB View Download
lgtm
Project Member

Comment 11 by bugdroid1@chromium.org, Dec 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2f32a659f1da7d65a343bff11bb8544969ecf276

commit 2f32a659f1da7d65a343bff11bb8544969ecf276
Author: sebsg <sebsg@chromium.org>
Date: Fri Dec 09 17:13:23 2016

[Payments] Move focus to next field in expired cvc unmask prompt.

Moves the focus to the expiration year field when the expiration month
field gets filled with a second character and move the focus to the
cvc input field when the expiration year field gets filled with a
second character.

Also adds more detailed error messages for invalid expiration month and
year.

BUG= 671762 

Review-Url: https://codereview.chromium.org/2557873002
Cr-Commit-Position: refs/heads/master@{#437571}

[modify] https://crrev.com/2f32a659f1da7d65a343bff11bb8544969ecf276/chrome/android/java/src/org/chromium/chrome/browser/autofill/CardUnmaskPrompt.java
[modify] https://crrev.com/2f32a659f1da7d65a343bff11bb8544969ecf276/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestExpiredLocalCardTest.java
[modify] https://crrev.com/2f32a659f1da7d65a343bff11bb8544969ecf276/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java
[modify] https://crrev.com/2f32a659f1da7d65a343bff11bb8544969ecf276/components/autofill_strings.grdp

Status: Fixed (was: Started)

Sign in to add a comment