countries API page (React, react-router-dom, API, SCSS, Vite)

Solution retrospective
since we can't style I decided to make a custom select menu that works like the native tag, It supports:
- arrow up/down navigation
- when select menu is open preselected element gets focus if it doesn't exists then first element or gets focus
- when Escape or Tab key are pushed it closes the menu while giving focus to menu button
- also dynamic select options
What challenges did you encounter, and how did you overcome them?export default function SelectMenu() { const { selectedOption, filterExpanded, selectOptions, handleClick, handleKeyDown, } = useSelectMenu(); return ( {selectedOption === '' ? 'Filter by Region' : selectedOption} {selectOptions.map((option) => ( {option} ))} ); }
kept animations until last minutes, wasn't a good idea
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Hassan El Jebyly's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord