Skip to content

Commit

Permalink
adds searching mode to editor
Browse files Browse the repository at this point in the history
  • Loading branch information
csrui committed Jul 13, 2022
1 parent 4feb105 commit 9c4fe2a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Http/Livewire/Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ class Editor extends Component
*/
public string $query = '';

/**
* Indicates if component is in search mode.
*
* @var boolean
*/
public bool $isSearching = false;

/**
* Class that will handle searching and listing.
*
Expand Down Expand Up @@ -93,6 +100,7 @@ protected function getAction() : AbstractQuery
public function search() : void
{
$this->eligebleForPermission = $this->getAction()->search($this->query)->get();
$this->isSearching = true;
}

/**
Expand All @@ -104,6 +112,7 @@ public function resetSearch() : void
{
$this->eligebleForPermission = collect();
$this->query = '';
$this->isSearching = false;
}

/**
Expand Down

0 comments on commit 9c4fe2a

Please sign in to comment.