Get default min and max default values in views exposed filter form element I have a views display that lists out content that meets a criteria defined by an exposed form. One of the filters is 2 values which a content attribute must be between. In views, I can define this as a default min and max value.

I would like to get these default values out as data attributes on the form fields for some javascript validation, and therefore will need to be able to get these as twig variables in the form element template, or set these as attributes in the form element preprocess.

The inputs initially have the value of the default min and max, but as soon as these are changed there is no way I can see to access the defaults.

How can I do this?
function MYTHEME_preprocess_input(&amp;$variables) {
  if (isset($variables['element']['#default_value'])){
    $variables['attributes']['data-default-value'] = $variables['element']['#default_value'];
  }
}