From 7dce53a77b70b7c07d5af43ce1250a013cf27d1f Mon Sep 17 00:00:00 2001 From: Robin Klaus Date: Wed, 6 May 2020 12:46:37 +1000 Subject: [PATCH] Added inputmode attribute to show appropriate mobile keyboard for selected field --- app/assets/javascripts/templates/forgot.html.haml | 1 + app/assets/javascripts/templates/login.html.haml | 2 ++ app/assets/javascripts/templates/signup.html.haml | 3 +++ app/views/checkout/_details.html.haml | 4 ++-- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/templates/forgot.html.haml b/app/assets/javascripts/templates/forgot.html.haml index 0157b6fc36..7d625fb084 100644 --- a/app/assets/javascripts/templates/forgot.html.haml +++ b/app/assets/javascripts/templates/forgot.html.haml @@ -20,6 +20,7 @@ type: "email", id: "email", tabindex: 1, + inputmode: "email", "ng-model" => "spree_user.email"} .row .large-12.columns diff --git a/app/assets/javascripts/templates/login.html.haml b/app/assets/javascripts/templates/login.html.haml index 9e1265edbd..7b2d3e33d1 100644 --- a/app/assets/javascripts/templates/login.html.haml +++ b/app/assets/javascripts/templates/login.html.haml @@ -15,6 +15,7 @@ type: "email", id: "email", tabindex: 1, + inputmode: "email", "ng-model" => "spree_user.email"} .row .large-12.columns @@ -24,6 +25,7 @@ id: "password", autocomplete: "off", tabindex: 2, + inputmode: "password", "ng-model" => "spree_user.password"} .row .large-12.columns diff --git a/app/assets/javascripts/templates/signup.html.haml b/app/assets/javascripts/templates/signup.html.haml index 51aa9d7fbc..0294813a5b 100644 --- a/app/assets/javascripts/templates/signup.html.haml +++ b/app/assets/javascripts/templates/signup.html.haml @@ -14,6 +14,7 @@ type: "email", id: "email", tabindex: 1, + inputmode: "email", "ng-model" => "spree_user.email"} %span.error{"ng-show" => "errors.email != null"} {{ errors.email.join(' ') }} @@ -25,6 +26,7 @@ id: "password", autocomplete: "off", tabindex: 2, + inputmode: "password", "ng-model" => "spree_user.password"} %span.error{"ng-show" => "errors.password != null"} {{ errors.password.join(' ') }} @@ -36,6 +38,7 @@ id: "password_confirmation", autocomplete: "off", tabindex: 2, + inputmode: "password", "ng-model" => "spree_user.password_confirmation"} .row .large-12.columns diff --git a/app/views/checkout/_details.html.haml b/app/views/checkout/_details.html.haml index 775c00c670..c573578ed5 100644 --- a/app/views/checkout/_details.html.haml +++ b/app/views/checkout/_details.html.haml @@ -21,10 +21,10 @@ .row .small-6.columns - = validated_input t(:email), 'order.email', type: :email, "ofn-focus" => "accordion['details']" + = validated_input t(:email), 'order.email', type: "email", inputmode: "email", "ofn-focus" => "accordion['details']" .small-6.columns - = validated_input t(:phone), 'order.bill_address.phone' + = validated_input t(:phone), 'order.bill_address.phone', inputmode: "tel" .row .small-12.columns.text-right