Hi, I love your little datalist select. THANKS!! Here are two bugfixes that I have figured out for some anomalous behavior:
after the 1st "opt && opt.focus();" add:
// bugfix: stopping event propagation prevents list immediately moving, just focuses on first option
e.preventDefault();
after the 2nd "opt && opt.focus();" add:
// bugfix: focused element position would jump in relation to view when it is at the bottom of the view
opt && opt.scrollIntoView({behavior: "instant", block: "center",});
Also you could mention in readme that people should run their browser with parameter --allow-file-access-from-files (Chrome/Chromium/Vivaldi/Edge) since external scripts are normally disabled when viewing your demo in browser with file:// protocol. For example recommend running Edge as:
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --allow-file-access-from-files
Hi, I love your little datalist select. THANKS!! Here are two bugfixes that I have figured out for some anomalous behavior:
after the 1st "opt && opt.focus();" add:
// bugfix: stopping event propagation prevents list immediately moving, just focuses on first optione.preventDefault();after the 2nd "opt && opt.focus();" add:
// bugfix: focused element position would jump in relation to view when it is at the bottom of the viewopt && opt.scrollIntoView({behavior: "instant", block: "center",});Also you could mention in readme that people should run their browser with parameter --allow-file-access-from-files (Chrome/Chromium/Vivaldi/Edge) since external scripts are normally disabled when viewing your demo in browser with file:// protocol. For example recommend running Edge as:
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --allow-file-access-from-files