- 🇬🇧United Kingdom masher
Cheers for the solution!
I had to amend the above code to work on Drupal 10:
use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_form_alter().
*/
function hook_form_alter(&$form, FormStateInterface $form_state, $form_id) {
// BEF: close selects of exposed form when value is selected.
if ($form_id == 'views_exposed_form') {
foreach ($form as $k => $v) {
if (str_contains($k, '_collapsible')) {
$form[$k]['#open'] = FALSE;
}
}
}
} - Status changed to Closed: duplicate
9 months ago 3:38pm 11 April 2024 - 🇺🇸United States smustgrave
Believe this should be covered by ✨ Allow not automatically opening collapsed filter Needs review