Skip to content

Enhancement: Ensure Only One Panel Opens at a Time in Flex Panels #729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

icabduqaadir12
Copy link

Day 05 – Flex Panel Gallery 🎨

📸 Live Demo


✨ Feature Enhancement: Accordion-Style Panel Behavior

This update modifies the toggle logic in the original Flex Panels project to improve user interaction by ensuring that only one panel can be open at a time. Previously, multiple panels could remain expanded simultaneously, which could clutter the interface and reduce clarity.


🔧 Changes Made

  • Updated the toggleOpen() function to:

    • Close all other panels by removing open and open-active classes.
    • Toggle the clicked panel open or closed.
  • Adjusted the toggleActive() function to:

    • Add open-active only when the panel is in the open state.
    • Ensure smooth animations using the transitionend event.

✅ Result

Now, when a user clicks on a panel:

  • Any previously opened panel automatically closes.
  • Only the clicked panel expands and displays its animated text.
  • The interface behaves like an accordion, improving UX while keeping all animations and layout transitions intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant