Request the numeric keyboard for digits-only postcode formats#101
Open
boo-code wants to merge 1 commit into
Open
Request the numeric keyboard for digits-only postcode formats#101boo-code wants to merge 1 commit into
boo-code wants to merge 1 commit into
Conversation
Collaborator
|
Hello @boo-code! This is your first pull request on ps_onepagecheckout repository of the PrestaShop project. Thank you, and welcome to this Open Source community! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
N= digit,L= letter,C= iso code — France, Germany, the US, Italy, Spain and most others are pureNNNNN), forcing a keyboard switch on every checkout. Keyboard optimization is one of the standard mobile checkout items (https://baymard.com/blog/mobile-checkout — 60% of top mobile sites fail at least 2 of 5 keyboard optimizations; the module already usestype="email"andtype="tel"). This setsinputmode="numeric"on the postcodeFormFieldviasetAttr()when the country'szip_code_formatmatches^N+$; formats with letters or separators keep the default keyboard, since the numeric layout could not type them. Rendering happens through the theme's form fields partial via the paired PrestaShop/hummingbird#1063 (core already exportsFormField::attrintoArray()and runs theadditionalHtmlAttributesFormFieldshook, but the partial never rendered the slot); with an older theme the attribute is simply not rendered and the behavior stays as today.vendor/bin/phpunit -c tests/php/phpunit.xml --filter AddressFieldsFormatTraitTest— asserts['inputmode' => 'numeric']for aNNNNNcountry and an empty attr map for a lettered (LN NL) and an empty format. With PrestaShop/hummingbird#1063 applied on a 9.2 shop, all four checkout postcode inputs (inline and modal, delivery and invoice) renderinputmode="numeric"for France — verified live; a touch device opens the digit keyboard on the field.