How do I override an exposed filter input type?
Try in this way:
function seven_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {
  if (in_array($form_id, ['node_page_form', 'node_page_edit_form'])) {
    $form['field_number']['widget'][0]['value']['#type'] = 'range';
  }
}

I think this post will help you, check once - https://www.drupal.org/project/drupal/issues/2958499#comment-12558959