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

Add autocomplete tags to address form fields on checkout #1542

Merged
merged 1 commit into from
Oct 31, 2016
Merged

Add autocomplete tags to address form fields on checkout #1542

merged 1 commit into from
Oct 31, 2016

Conversation

mtomov
Copy link
Contributor

@mtomov mtomov commented Oct 20, 2016

After this change, Chrome autocompletes all fields per address*

  • State must be available in the select box to autocomplete

Specification available at:

Well explained at:

@mtomov mtomov changed the title Add autocomplete tags to address form fields on frontend checkout Add autocomplete tags to address form fields on checkout Oct 20, 2016
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although we plan to remove frontend html in a future version of solidus, I think this is good for now. It's a good start for new devs and can (and most likely will) be overridden by more experiences devs anyway.

So, from me 👍

@tvdeyen
Copy link
Member

tvdeyen commented Oct 20, 2016

As a bonus, as we're already here we could also add required: true to trigger browser based validation. But this is up to you to decide. This is good as it is right now.

Thanks for your contribution 🍭

@mtomov
Copy link
Contributor Author

mtomov commented Oct 20, 2016

There's actually that beast here - jQuery.validate that takes care of javascript validations. Not sure if it will play well with the html validations as it's a rather old version.

As the address form is the only one to use this plugin, as far as I know, (payment form uses a different plugin), if you consider it appropriate, I can remove jQuery validate altogether and replace the presence validations with html5 ones. Whoever wants then can add a validation plugin of their own (such as the Foundation's one Abide, or I'm sure bootstrap must also have one)

I think even for experienced developers - having a reference to what exactly the correct auto-complete attributes are, without having to search for, is great to have.

@tvdeyen
Copy link
Member

tvdeyen commented Oct 20, 2016

👍 for removing jQuery.validate and replace it with HTML5 based validations. But this is just my 2 cents. Would like to here the others @jhawthorn @gmacdougall WDYT?

@tvdeyen tvdeyen added type:enhancement Proposed or newly added feature changelog:solidus_frontend Changes to the solidus_frontend gem Code review needed labels Oct 20, 2016
@cbrunsdon
Copy link
Contributor

I'm pro swapping to html5 validations as well, though I know very little about them.

@jhawthorn
Copy link
Contributor

This looks good to me 👍

I've created a separate issue #1548 to discuss removing jquery.validate in favour of plain HTML validations.

One thing that still doesn't autofill correctly is the state/province. Presumably because the dropdown is filled in via javascript. It would be great if that worked (but it may not be possible).

@tvdeyen
Copy link
Member

tvdeyen commented Oct 21, 2016

Thanks @jhawthorn

  * on frontend checkout

  After this change, Chrome autocompletes all fields per address*

    * State must be available in the select box to autocomplete

  Specification available at:

    * https://html.spec.whatwg.org/multipage/forms.html#attr-fe-autocomplete-given-name

  Well explained at:

   * https://cloudfour.com/thinks/autofill-what-web-devs-should-know-but-dont/
@jhawthorn jhawthorn merged commit af83fca into solidusio:master Oct 31, 2016
@mtomov mtomov deleted the autocomplete-address branch October 31, 2016 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_frontend Changes to the solidus_frontend gem type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants