Skip to content

NOW MANAGED ON CODEBERG

Adds autofocus on the email field of the standard login page.

Virgile3bcfe2a460d8
diff --git a/resources/views/auth/forms/login/standard.blade.php b/resources/views/auth/forms/login/standard.blade.php
index dc6081637..bfe437a8c 100644
--- a/resources/views/auth/forms/login/standard.blade.php
+++ b/resources/views/auth/forms/login/standard.blade.php
@@ -1,6 +1,6 @@
<div class="form-group">
<label for="email">{{ trans('auth.email') }}</label>
- @include('form.text', ['name' => 'email', 'tabindex' => 1])
+ @include('form.text', ['name' => 'email', 'tabindex' => 1, 'focus' => 1])
</div>
<div class="form-group">
diff --git a/resources/views/form/text.blade.php b/resources/views/form/text.blade.php
index 909e87286..89e72ddb4 100644
--- a/resources/views/form/text.blade.php
+++ b/resources/views/form/text.blade.php
@@ -1,4 +1,5 @@
<input type="text" id="{{ $name }}" name="{{ $name }}"
+ @if(isset($focus)) autofocus @endif
@if($errors->has($name)) class="text-neg" @endif
@if(isset($placeholder)) placeholder="{{$placeholder}}" @endif
@if(isset($disabled) && $disabled) disabled="disabled" @endif
@@ -6,4 +7,4 @@
@if(isset($model) || old($name)) value="{{ old($name) ? old($name) : $model->$name}}" @endif>
@if($errors->has($name))
<div class="text-neg text-small">{{ $errors->first($name) }}</div>
-@endif
\ No newline at end of file
+@endif