Skip to content

Commit

Permalink
Always dispatch params updated to fix LfTags
Browse files Browse the repository at this point in the history
  • Loading branch information
afonic committed Nov 7, 2024
1 parent 863572e commit c64c40e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/Http/Livewire/LivewireCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public function filterUpdated($field, $condition, $payload, $modifier)
$this->resetPagination();
if ($payload === '' || $payload === null || $payload === []) {
$this->clearFilter($field, $condition, $modifier);
$this->dispatchParamsUpdated();

return;
}
Expand Down
4 changes: 4 additions & 0 deletions src/Http/Livewire/Traits/HandleParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,14 @@ public function clearFilter($field, $condition, $modifier): void
$queryScopeKey = 'query_scope';
$modifierKey = $modifier.':'.$field;
unset($this->params[$queryScopeKey], $this->params[$modifierKey]);
$this->dispatchParamsUpdated();

return;
}
if ($condition === 'taxonomy') {
$paramKey = 'taxonomy:'.$field.':'.$modifier;
unset($this->params[$paramKey]);
$this->dispatchParamsUpdated();

return;
}
Expand All @@ -131,10 +133,12 @@ public function clearFilter($field, $condition, $modifier): void
$maxParamKey = $field.':'.$maxModifier;

unset($this->params[$minParamKey], $this->params[$maxParamKey]);
$this->dispatchParamsUpdated();

return;
}
unset($this->params[$field.':'.$condition]);
$this->dispatchParamsUpdated();
}

protected function toPipeSeparatedString($payload): string
Expand Down

0 comments on commit c64c40e

Please sign in to comment.