Commit 6cde1079 authored by Neslee's avatar Neslee
Browse files

Issue #3162656 by Radelson, gilles_webstanz: Reset button still appear when there is no user input

parent 7fecf959
......@@ -819,7 +819,10 @@ class BetterExposedFilters extends InputRequired {
// If our form has no visible filters, hide the submit button.
$has_visible_filters = !empty(Element::getVisibleChildren($form)) ?: FALSE;
$form['actions']['submit']['#access'] = $has_visible_filters;
$form['actions']['reset']['#access'] = $has_visible_filters;
// Never enable a reset button that has already been disabled.
if (!isset($form['actions']['reset']['#access']) || $form['actions']['reset']['#access'] === TRUE) {
$form['actions']['reset']['#access'] = $has_visible_filters;
}
// Ensure default process/pre_render callbacks are included when a BEF
// widget has added their own.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment