Neat! Have you considered making this into a custom component that could be reused?
Probably not a bad idea with a little clean-up!
Awesome idea man. Love it!
Hi all - I needed an auto-complete function for 300,000+ UK addresses and added a few bells and whistles to the really helpful first version by @navigate (above).
Here’s what I came up with if you’d like to clone and evolve…
Now if anyone can tell me how to remove the vertical blank space between results…?
Just in case it helps:
No idea how it stacks up to what this thread shows, but I put together a POC for a trie implementation a while ago. I think they are supposed to be really fast AFAIK.
clone and description:
If you are in need of speed it might help.
Often setting the role of all labels and links to
text helps removing all that padding.
If it works you are lucky. If it doesn’t you’ll need to dig in the CSS.
PSA: An Autocomplete component is also available as part of Anvil Extras.