Electron input with datalist


#1

Hi, I am facing a problem when I want to read the value of an input that have suggestions from datalist, the value that I get from the input is only what I type with the keyboard not the selected value, i’ll give an example to explain better, for the HTML bellow, if I type ‘on’ than I select the suggestion which is ‘111’ when I try to read the value of the input (document.getElementById(“num”).value) I get ‘on’ instead of ‘111’, any suggestions to fix it??

    <input type="text" list="numbrs" id="num">
	<datalist id="numbrs">
		<option value="111">One</option>
		<option value="222">two</option>
	</datalist>

#2

I could solve the issue by using SELECT2 and Jquery Autocomplete.