don't autocomplete on mouseover (furbooru/philomena#15)

This commit is contained in:
byte[] 2020-09-10 03:04:47 -04:00
parent fd4843a39b
commit 912e64559b

View file

@ -54,15 +54,14 @@ function createItem(list, suggestion) {
item.addEventListener('mouseover', () => { item.addEventListener('mouseover', () => {
removeSelected(); removeSelected();
item.classList.add('autocomplete__item--selected'); item.classList.add('autocomplete__item--selected');
inputField.value = item.dataset.value;
}); });
item.addEventListener('mouseout', () => { item.addEventListener('mouseout', () => {
inputField.value = originalTerm;
removeSelected(); removeSelected();
}); });
item.addEventListener('click', () => { item.addEventListener('click', () => {
inputField.value = item.dataset.value;
inputField.dispatchEvent( inputField.dispatchEvent(
new CustomEvent('autocomplete', { new CustomEvent('autocomplete', {
detail: { detail: {