Skip to content

Commit 64b41dc

Browse files
yphojuliomotol-hdmd
authored andcommitted
Changing the select element to multiple checkboxes
1 parent 3cb7426 commit 64b41dc

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed
Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
<div class="mt-1 relative rounded-md shadow-sm">
2-
<select
3-
wire:model.stop="filters.{{ $key }}"
4-
wire:key="filter-{{ $key }}"
5-
id="filter-{{ $key }}"
6-
class="rounded-md shadow-sm block w-full pl-3 pr-10 py-2 text-base leading-6 border-gray-300 focus:outline-none focus:border-indigo-300 focus:shadow-outline-indigo sm:text-sm sm:leading-5"
7-
multiple="multiple"
8-
>
9-
@foreach($filter->options() as $key => $value)
10-
<option value="{{ $key }}">{{ $value }}</option>
11-
@endforeach
12-
</select>
1+
<div class="mt-1 relative rounded-md">
2+
{{-- We're not using a select element, but for UX, we choose checkboxes--}}
3+
{{-- <select--}}
4+
{{-- wire:model.stop="filters.{{ $key }}"--}}
5+
{{-- wire:key="filter-{{ $key }}"--}}
6+
{{-- id="filter-{{ $key }}"--}}
7+
{{-- class="rounded-md shadow-sm block w-full pl-3 pr-10 py-2 text-base leading-6 border-gray-300 focus:outline-none focus:border-indigo-300 focus:shadow-outline-indigo sm:text-sm sm:leading-5"--}}
8+
{{-- multiple="multiple"--}}
9+
{{-- >--}}
10+
{{-- @foreach($filter->options() as $key => $value)--}}
11+
{{-- <option value="{{ $key }}">{{ $value }}</option>--}}
12+
{{-- @endforeach--}}
13+
{{-- </select>--}}
14+
15+
@foreach($filter->options() as $k => $value)
16+
<input
17+
type="checkbox"
18+
id="filter-{{$key}}-{{ $loop->index }}"
19+
wire:key="filter-{{$key}}-{{ $loop->index }}"
20+
wire:model.stop="filters.{{$key}}.{{ $loop->index }}"
21+
value="{{ $k }}"
22+
>
23+
<label for="filter-{{$key}}-{{ $loop->index }}">{{ $value }}</label>
24+
<br>
25+
@endforeach
1326
</div>

0 commit comments

Comments
 (0)