From 7b741ecb25cb08534996b88c3a8a728626ca132b Mon Sep 17 00:00:00 2001 From: Iosif Chatzimichail Date: Thu, 29 Feb 2024 00:38:21 +0200 Subject: [PATCH] Fixes #16 --- src/Http/Livewire/LfCheckboxFilter.php | 2 ++ src/Http/Livewire/LfDateFilter.php | 2 ++ src/Http/Livewire/LfRadioFilter.php | 2 ++ src/Http/Livewire/LfRangeFilter.php | 2 ++ src/Http/Livewire/LfTextFilter.php | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/Http/Livewire/LfCheckboxFilter.php b/src/Http/Livewire/LfCheckboxFilter.php index f0ef938..a491fe1 100644 --- a/src/Http/Livewire/LfCheckboxFilter.php +++ b/src/Http/Livewire/LfCheckboxFilter.php @@ -82,6 +82,8 @@ public function rules() #[On('preset-params')] public function setPresetSort($params) { + $this->dispatchFilterMounted(); + if (array_key_exists($this->getParamKey(), $params)) { $this->selected = explode('|', $params[$this->getParamKey()]); $this->previousSelected = $this->selected; diff --git a/src/Http/Livewire/LfDateFilter.php b/src/Http/Livewire/LfDateFilter.php index 4142081..981d6fd 100644 --- a/src/Http/Livewire/LfDateFilter.php +++ b/src/Http/Livewire/LfDateFilter.php @@ -45,6 +45,8 @@ public function clear() #[On('preset-params')] public function setPresetSort($params) { + $this->dispatchFilterMounted(); + if (array_key_exists($this->getParamKey(), $params)) { $this->selected = $params[$this->getParamKey()]; } diff --git a/src/Http/Livewire/LfRadioFilter.php b/src/Http/Livewire/LfRadioFilter.php index f6eb618..239a157 100644 --- a/src/Http/Livewire/LfRadioFilter.php +++ b/src/Http/Livewire/LfRadioFilter.php @@ -61,6 +61,8 @@ public function rules() #[On('preset-params')] public function setPresetSort($params) { + $this->dispatchFilterMounted(); + if (array_key_exists($this->getParamKey(), $params)) { $this->selected = $params[$this->getParamKey()]; } diff --git a/src/Http/Livewire/LfRangeFilter.php b/src/Http/Livewire/LfRangeFilter.php index 2af1073..02bc45b 100644 --- a/src/Http/Livewire/LfRangeFilter.php +++ b/src/Http/Livewire/LfRangeFilter.php @@ -54,6 +54,8 @@ public function livewireComponentReady() #[On('preset-params')] public function setPresetSort($params) { + $this->dispatchFilterMounted(); + if (array_key_exists($this->getParamKey(), $params)) { $this->selected = $params[$this->getParamKey()]; } diff --git a/src/Http/Livewire/LfTextFilter.php b/src/Http/Livewire/LfTextFilter.php index ec0cd3f..48f7e9c 100644 --- a/src/Http/Livewire/LfTextFilter.php +++ b/src/Http/Livewire/LfTextFilter.php @@ -36,6 +36,8 @@ public function clear() #[On('preset-params')] public function setPresetSort($params) { + $this->dispatchFilterMounted(); + if (array_key_exists($this->getParamKey(), $params)) { $this->selected = $params[$this->getParamKey()]; }