Custom Widget doesn't save Values 🤔

My custom Widget does not remember the previouse checked Input Values. Whats Wrong?
Widget works, expect the prev checked inputs…:thinking:

  const customMenuRenderFn = (renderParams, isFirstRendering) => {
  // widgetParams contains all the original options used to instantiate the widget on the page.
 const $container=$(renderParams.widgetParams.containerNode);
 const divName=renderParams.widgetParams.containerNode

  const title = renderParams.widgetParams.title || 't';

lg('cotainer',$container)
  if (isFirstRendering) {
    // replace `document.body` with the container provided by the user
    // and also the new title
    $container.append(`
      <div class="inputs ais-RefinementList-list" ></div>
    `);

    const refine = renderParams.refine; 
    lg('renderParams',renderParams)
    $container.on('change','input', ({target}) => {
        lg('renderParams',renderParams)
      refine(target.value);
    });
  }

  const items = renderParams.items;
  
  const optionsHTML = items.map(({value, isRefined, label, count}) => 

  ` <div class="ais-RefinementList-item">
        <div>
          <input type="checkbox" id="${uniq(value,5)}" name="${uniq(value,5)}" value="${value}" ${isRefined ? 'checked' : ''}>
          <label for="${uniq(value,5)}">${label}-${isRefined}</label>
        </div>
      </div>`);
 
  //  $container.find('select').html(optionsHTML);
  var div1=document.querySelector(divName)
  var sel=div1.querySelector('.inputs')
 var  htmlFull= optionsHTML.join('');

  if(optionsHTML.length){
    $container.html(htmlFull )
  }

//   $(divName).find('select').html(optionsHTML);
}


const dropdownMenu = instantsearch.connectors.connectMenu(customMenuRenderFn);