Submitted over 1 year agoA solution to the REST Countries API with color theme switcher challenge
countries API page (React, react-router-dom, API, SCSS, Vite)
accessibility, react, sass/scss, vite, react-router
@hassaneljebyly

Solution retrospective
What are you most proud of, and what would you do differently next time?
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
export default function SelectMenu() {
const {
selectedOption,
filterExpanded,
selectOptions,
handleClick,
handleKeyDown,
} = useSelectMenu();
return (
{selectedOption === '' ? 'Filter by Region' : selectedOption}
{selectOptions.map((option) => (
{option}
))}
);
}
What challenges did you encounter, and how did you overcome them?
kept animations until last minutes, wasn't a good idea
Code
Loading...
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