Skip to content

Commit 803634c

Browse files
Whether search work: debounce or lazy
1 parent ec556bb commit 803634c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

resources/views/includes/_options.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
@if ($searchEnabled)
2222
<div class="col">
2323
<input
24-
@if (is_numeric($searchDebounce)) wire:model.debounce.{{ $searchDebounce }}ms="search" @endif
24+
@if (is_numeric($searchDebounce)&&$searchType=='debounce') wire:model.debounce.{{ $searchDebounce }}ms="search" @endif
25+
@if ($searchType=='lazy') wire:model.lazy="search" @endif
2526
@if ($disableSearchOnLoading) wire:loading.attr="disabled" @endif
2627
class="form-control"
2728
type="text"

src/Traits/Search.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ trait Search
1111
* Search.
1212
*/
1313

14+
15+
/**
16+
* Whether search work: debounce or lazy
17+
* @var string
18+
*/
19+
public $searchType = 'debounce';
20+
1421
/**
1522
* Whether or not searching is enabled.
1623
*

0 commit comments

Comments
 (0)