Skip to content

Commit

Permalink
Added extra styling for AlpineJs
Browse files Browse the repository at this point in the history
  • Loading branch information
asantibanez committed Jun 11, 2020
1 parent 5b6a84a commit 92804a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/views/search-option-item.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class="{{ $styles['searchOptionItem'] }}"

wire:click.stop="selectValue('{{ $option['value'] }}')"

x-bind:class="{ 'bg-gray-100': selectedIndex === {{ $index }} }"
x-bind:class="{ '{{ $styles['searchOptionItemActive'] }}': selectedIndex === {{ $index }}, '{{ $styles['searchOptionItemInactive'] }}': selectedIndex !== {{ $index }} }"
x-on:mouseover="selectedIndex = {{ $index }}"
>
{{ $option['description'] }}
Expand Down
6 changes: 5 additions & 1 deletion src/LivewireSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ public function styles()
'search' => 'relative',
'searchInput' => 'p-2 rounded border w-full rounded',
'searchOptionsContainer' => 'absolute top-0 left-0 mt-12 w-full z-10',
'searchOptionItem' => 'bg-white p-3 border-b hover:bg-gray-100 cursor-pointer text-gray-700 text-sm',

'searchOptionItem' => 'p-3 hover:bg-gray-100 cursor-pointer text-sm',
'searchOptionItemActive' => 'bg-indigo-600 text-white font-medium',
'searchOptionItemInactive' => 'bg-white text-gray-600',

'searchNoResults' => 'p-8 w-full bg-white border text-center text-xs text-gray-600',
];
}
Expand Down

0 comments on commit 92804a4

Please sign in to comment.