You have to add attribute tabindex="-1" and set .focus() on active element.
Look at my patch here
https://github.com/ashokvishwakarma/preact-typeahead/commit/2dc53c3c5abc37b1a0428889917608a4a0740123
autofocus to selected element ยท ashokvishwakarma/preact-typeahead@2dc53c3A
TypeHead component for Preact. Contribute to ashokvishwakarma/preact-typeahead
development by creating an account on GitHub.GitHubashokvishwakarma