Deepak – 06-47 Aug 10

How can I navigate a list through arrow keys?
{SearchResult.map((country)=>{
return <div className='border-b'>{country.properties.name}</div>
})}
{SearchResult.map((country)=>{
return <div className='border-b'>{country.properties.name}</div>
})}
S
ScriptyChris617d ago
What do you mean by navigate? Highlight list items or what?
D
Deepak617d ago
its a search suggestion. kind of drop down of countries when i type. but i want to select the right country using the arrow keys
S
ScriptyChris617d ago
I suggest you use <datalist> element https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist It handles arrow key navigation out of the box
D
Deepak617d ago
I can use many npm packages if were to handle it out of the box but thanks for your suggestion
UU
Unknown User617d ago