Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

FAQ accordion component using CSS Flex and Javascript

P

@Antonvasilache

Desktop design screenshot for the FAQ accordion coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

  • Completed the first challenge that includes JavaScript.
  • Implemented both clicking and keyboard functionality.
  • Faster completion of the static webpage part.
  • Should have used state variables.

What challenges did you encounter, and how did you overcome them?

  • Creating the accordion with only one item open at a time - had to make use of extensive class manipulation to achieve the desired effect.
  • Adding keyboard navigation on top of the clicking functionality proved difficult due to the default behaviour of some events. Pressing Enter would focus the next item, so I managed to stop it using e.stopPropagation()
  • Adding dividers as div elements between the accordion items broke the keyboard navigation - had to remove them and add padding and border-bottom instead

What specific areas of your project would you like help with?

  • There is probably a more efficient way of managing state for the opened/closed items.
  • Refactoring the code to something less repetitive.
  • Sizing the page elements with less reliance on media queries.

Community feedback

Aaliyan10 190

@Aaliyan10

Posted

Great Work!

1

Please log in to post a comment

Log in with GitHub
Discord logo

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