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/[email protected]
A TypeHead component for Preact. Contribute to ashokvishwakarma/preact-typeahead development by creating an account on GitHub.