You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wish to use a custom list for the autocomplete (prevent an issue with an overflow), ex use case the autocomplete from gmail, the list is inside the body not next to the input.
Found a way to use another list (the list is not static):
constid=setTimeout(()=>{$.bind(this.ul,{"mousedown": function(evt){varli=evt.target;if(li!==this){while(li&&!/li/i.test(li.nodeName)){li=li.parentNode;}if(li&&evt.button===0){// Only selectonleftclickevt.preventDefault();me.select(li,evt.target);}}}});clearTimeout(id);},100);
Quick and dirty, but it's working.
Maybe using event delegation ? Or adding a option to set a custom ul as autocomplete list.
Then we need to update the CSS too, because with a custom style it works, but the default CSS won't work.
Edit: Found a better way to do it, cf PR.
The text was updated successfully, but these errors were encountered:
dhoko
pushed a commit
to dhoko/awesomplete
that referenced
this issue
Oct 7, 2016
Hi,
I wish to use a custom list for the autocomplete (prevent an issue with an overflow), ex use case the autocomplete from gmail, the list is inside the body not next to the input.
Found a way to use another list (the list is not static):
It works, but the lib won't do anything on click.
Found a way to patch it,
Quick and dirty, but it's working.
Maybe using event delegation ? Or adding a option to set a custom ul as autocomplete list.
Then we need to update the CSS too, because with a custom style it works, but the default CSS won't work.
Edit: Found a better way to do it, cf PR.
The text was updated successfully, but these errors were encountered: