Skip to content

Commit

Permalink
Expand user admin additional filters if form data has any values
Browse files Browse the repository at this point in the history
This improves user experience, if any of the collapsed filter values
has been entered, the filter group will be expanded.

Co-authored-by: Matus Kalafut <[email protected]>
Co-authored-by: Peter Dulacka <[email protected]>

#17
  • Loading branch information
Kirill Panshin authored and rootpd committed Apr 12, 2023
1 parent c524353 commit f49bea0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Presenters/UsersAdminPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,14 @@ public function createComponentAdminFilterForm()
$form->onSuccess[] = [$this, 'adminFilterSubmitted'];

$form->setDefaults($this->adminFilterFormData->getFormValues());

foreach ($collapseGroup->getControls() as $control) {
if (!empty($control->getValue())) {
$collapseGroup->setOption('container', 'div class="collapse in"');
break;
}
}

return $form;
}

Expand Down

0 comments on commit f49bea0

Please sign in to comment.