Skip to content

Commit 2eab28d

Browse files
dapiclaude
andcommitted
fix: Remove autofocus from landing page phone fields
Autofocus on phone inputs caused unwanted scroll-to-form behavior on mobile devices when visiting landing pages. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3d317a4 commit 2eab28d

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

app/views/landing/lp1.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ section#form.py-20.md:py-32.bg-gradient-to-br.from-gray-900.via-blue-900.to-gray
441441

442442
div
443443
= f.label :phone, "Телефон", class: "block text-sm font-semibold text-gray-700 mb-2"
444-
= f.telephone_field :phone, class: "w-full px-4 py-4 text-lg border-2 border-gray-200 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-gray-50 placeholder-gray-400 text-gray-900", placeholder: "+7 (999) 123-45-67", required: true, inputmode: "tel", autofocus: true
444+
= f.telephone_field :phone, class: "w-full px-4 py-4 text-lg border-2 border-gray-200 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-gray-50 placeholder-gray-400 text-gray-900", placeholder: "+7 (999) 123-45-67", required: true, inputmode: "tel"
445445

446446
div
447447
= f.label :name, "Ваше имя", class: "block text-sm font-semibold text-gray-700 mb-2"

app/views/landing/lp_magic_1.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ section#form.py-20.md:py-32.bg-gradient-to-br.from-slate-900.via-blue-900.to-sla
556556

557557
div
558558
= f.label :phone, "Телефон", class: "block text-sm font-semibold text-slate-700 mb-2"
559-
= f.telephone_field :phone, class: "w-full px-4 py-4 text-lg border-2 border-slate-200 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-slate-50 placeholder-slate-400 text-slate-900 transition-all", placeholder: "+7 (999) 123-45-67", required: true, inputmode: "tel", autofocus: true
559+
= f.telephone_field :phone, class: "w-full px-4 py-4 text-lg border-2 border-slate-200 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-slate-50 placeholder-slate-400 text-slate-900 transition-all", placeholder: "+7 (999) 123-45-67", required: true, inputmode: "tel"
560560

561561
div
562562
= f.label :name, "Ваше имя", class: "block text-sm font-semibold text-slate-700 mb-2"

app/views/landing/lp_magic_2.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ section#form.py-28.lg:py-36.bg-gradient-to-br.from-blue-600.via-blue-700.to-blue
426426
= f.hidden_field :utm_campaign, data: { utm_target: "campaign" }
427427

428428
/ Phone input - large
429-
= f.telephone_field :phone, class: "w-full px-6 py-5 text-lg border-2 border-slate-200 rounded-2xl focus:ring-4 focus:ring-blue-100 focus:border-blue-500 bg-slate-50 text-slate-900 transition-all placeholder-slate-400", placeholder: "+7 (999) 123-45-67", required: true, inputmode: "tel", autofocus: true
429+
= f.telephone_field :phone, class: "w-full px-6 py-5 text-lg border-2 border-slate-200 rounded-2xl focus:ring-4 focus:ring-blue-100 focus:border-blue-500 bg-slate-50 text-slate-900 transition-all placeholder-slate-400", placeholder: "+7 (999) 123-45-67", required: true, inputmode: "tel"
430430

431431
/ Submit button
432432
= f.submit "Жду звонка", class: "w-full bg-blue-600 text-white font-bold py-5 rounded-2xl text-lg hover:bg-blue-700 active:bg-blue-800 transition-all cursor-pointer shadow-lg shadow-blue-600/30 hover:shadow-xl hover:shadow-blue-600/40 hover:-translate-y-0.5"

app/views/landing/lp_magic_3.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ section#form.py-20.bg-gradient-to-br.from-orange-500.to-red-600.text-white.relat
403403

404404
div
405405
= f.label :phone, "Телефон", class: "block text-sm font-semibold text-slate-700 mb-2"
406-
= f.telephone_field :phone, class: "w-full px-4 py-4 text-lg border-2 border-slate-200 rounded-xl focus:ring-2 focus:ring-orange-500 focus:border-orange-500 bg-slate-50 text-slate-900", placeholder: "+7 (999) 123-45-67", required: true, inputmode: "tel", autofocus: true
406+
= f.telephone_field :phone, class: "w-full px-4 py-4 text-lg border-2 border-slate-200 rounded-xl focus:ring-2 focus:ring-orange-500 focus:border-orange-500 bg-slate-50 text-slate-900", placeholder: "+7 (999) 123-45-67", required: true, inputmode: "tel"
407407

408408
div
409409
= f.label :name, "Ваше имя", class: "block text-sm font-semibold text-slate-700 mb-2"

app/views/landing/show.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ section#form.py-16.md:py-20.px-4.bg-blue-600.text-white
163163
.space-y-5
164164
div.text-left
165165
= f.label :phone, "Телефон", class: "block text-sm font-semibold text-gray-700 mb-2"
166-
= f.telephone_field :phone, class: "w-full px-4 py-4 text-lg border-2 border-gray-300 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-gray-50 placeholder-gray-400", placeholder: "+7 (999) 123-45-67", required: true, inputmode: "tel", autofocus: true
166+
= f.telephone_field :phone, class: "w-full px-4 py-4 text-lg border-2 border-gray-300 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-gray-50 placeholder-gray-400", placeholder: "+7 (999) 123-45-67", required: true, inputmode: "tel"
167167

168168
div.text-left
169169
= f.label :name, "Ваше имя", class: "block text-sm font-semibold text-gray-700 mb-2"

0 commit comments

Comments
 (0)