Passing the search element when item selected. This is needed to use the item value. Like here:
onSelectItem: (item, input) => { input.dataset.value = item.value; //to set value to dataset input.previousElementSibling?.setAttribute('value', item.value); //to set value to input[type=hidden] }
Passing the search element when item selected. This is needed to use the item value. Like here:
onSelectItem: (item, input) => { input.dataset.value = item.value; //to set value to dataset input.previousElementSibling?.setAttribute('value', item.value); //to set value to input[type=hidden] }