mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Added focus and a11y attributes/functionality to custom checkboxes
Closes #1476
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
'name' => 'remember',
|
||||
'checked' => false,
|
||||
'value' => 'on',
|
||||
'tabindex' => 1,
|
||||
'label' => trans('auth.remember_me'),
|
||||
])
|
||||
</div>
|
||||
|
@@ -3,9 +3,13 @@ $name
|
||||
$value
|
||||
$checked
|
||||
$label
|
||||
$tabindex
|
||||
--}}
|
||||
<label class="toggle-switch @if($errors->has($name)) text-neg @endif">
|
||||
<label custom-checkbox class="toggle-switch @if($errors->has($name)) text-neg @endif">
|
||||
<input type="checkbox" name="{{$name}}" value="{{ $value }}" @if($checked) checked="checked" @endif>
|
||||
<span class="custom-checkbox text-primary">@icon('check')</span>
|
||||
<span tabindex="{{ $tabindex ?? '0' }}"
|
||||
role="checkbox"
|
||||
aria-checked="{{ $checked ? 'true' : 'false' }}"
|
||||
class="custom-checkbox text-primary">@icon('check')</span>
|
||||
<span class="label">{{$label}}</span>
|
||||
</label>
|
@@ -1,6 +1,9 @@
|
||||
<label toggle-switch="{{$name}}" class="toggle-switch">
|
||||
<label toggle-switch="{{$name}}" custom-checkbox class="toggle-switch">
|
||||
<input type="hidden" name="{{$name}}" value="{{$value?'true':'false'}}"/>
|
||||
<input type="checkbox" @if($value) checked="checked" @endif>
|
||||
<span class="custom-checkbox text-primary">@icon('check')</span>
|
||||
<span tabindex="{{ $tabindex ?? '0' }}"
|
||||
role="checkbox"
|
||||
aria-checked="{{ $value ? 'true' : 'false' }}"
|
||||
class="custom-checkbox text-primary">@icon('check')</span>
|
||||
<span class="label">{{ $label }}</span>
|
||||
</label>
|
Reference in New Issue
Block a user