Jun 04, 2019 in Drupal 8, Snippets

Enable the inline_form_errors module included in core and add the following snippet. 

/**
 * @param $form
 * @param FormStateInterface $form_state
 * @param $form_id
 * Labels of exposed form improvement
 */
function MYMODULE_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  if($form_id == 'views_exposed_form' && $form['#id'] == 'views-exposed-form-MYVIEWNAME') {
    $form['search']['#attributes']['required'] = '';
  }
}