diff --git a/modules/backend/widgets/Lists.php b/modules/backend/widgets/Lists.php index 65b8d742ce..755307038a 100644 --- a/modules/backend/widgets/Lists.php +++ b/modules/backend/widgets/Lists.php @@ -1489,10 +1489,19 @@ public function addFilter(callable $filter) public function setSearchTerm($term, $resetPagination = false) { if ( - strlen($this->searchTerm) !== 0 - && trim($this->searchTerm) !== '' + strlen($term) !== 0 + && trim($term) !== '' ) { + if ($this->showTree === true) { + // save initial list config showTree value + $this->putSession('showTree', true); + } $this->showTree = false; + } else { + if ($this->getSession('showTree')) { + // restore initial list config showTree value + $this->showTree = true; + } } if ($resetPagination) {