addon/snapshot.js
function setAttributeValues(dom) {
  // List of input types here https://www.w3.org/TR/html5/forms.html#the-input-element

  // Limit scope to inputs only as textareas do not retain their value when cloned
  let elems = dom.find(
    `input[type=text], input[type=search], input[type=tel], input[type=url], input[type=email],
     input[type=password], input[type=number], input[type=checkbox], input[type=radio]`
  );

  percyJQuery(elems).each(function() {
    let elem = percyJQuery(this);
    switch(elem.attr('type')) {
      case 'checkbox':
      case 'radio':
        if (elem.is(':checked')) {
          elem.attr('checked', '');
        }
        break;
      default:
        elem.attr('value', elem.val());
    }
  });

  return dom;
}
function setAttributeValues(dom) {
  // List of input types here https://www.w3.org/TR/html5/forms.html#the-input-element

  // Limit scope to inputs only as textareas do not retain their value when cloned
  let elems = dom.find(
    `input[type=text], input[type=search], input[type=tel], input[type=url], input[type=email],
     input[type=password], input[type=number], input[type=checkbox], input[type=radio]`
  );

  percyJQuery(elems).each(function() {
    let elem = percyJQuery(this);
    switch(elem.attr('type')) {
      case 'checkbox':
      case 'radio':
        if (elem.is(':checked')) {
          elem.attr('checked', '');
        }
        break;
      default:
        elem.attr('value', elem.val());
    }
  });

  return dom;
}
function setAttributeValues ( dom ) { // List of input types here https://www.w3.org/TR/html5/forms.html#the-input-element // Limit scope to inputs only as textareas do not retain their value when cloned let elems = dom . find ( ` ` ) ; percyJQuery ( elems ) . each ( function ( ) { let elem = percyJQuery ( this ) ; switch ( elem . attr ( 'type' ) ) { case 'checkbox' : case 'radio' : if ( elem . is ( ':checked' ) ) { elem . attr ( 'checked' , '' ) ; } break ; default : elem . attr ( 'value' , elem . val ( ) ) ; } } ) ; return dom ; }
Set the property value into the attribute value for snapshotting inputs
Set the property value into the attribute value for snapshotting inputs