Skip to content
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

🐛 Bug Report: Accordion in FAQ / Q&A triggers on any keypress #154

Open
1 task done
adeyinkaezra123 opened this issue Oct 3, 2023 · 2 comments
Open
1 task done

Comments

@adeyinkaezra123
Copy link

📜 Description

In the Q&A section, the expanded state of a chosen drawer toggles frequently with each keypress, causing keyboard-based navigation to feel unstable. This makes actions keyboard-based navigation a bit wobbly or in my case link navigation to a new with Ctrl + click page disabled.

👟 Reproduction steps

  1. Go to the Q&A section, expand a drawer.
  2. Press any key on the keyboard, and notice how the drawer expands and contracts on keypress
  3. Also try scrolling with the Arrow Down ⬇️ key, notice that the effect still persists.

👍 Expected behavior

The Accordion component should not be triggered by just any keypress, preferably, Escape, and probably clicking outside the borders of the component should hide the drawers. Additionally, the Tab key can also be used to expand the next drawer, whilst hiding the previous one

👎 Actual Behavior with Screenshots

A video would do more justice

Untitled.video.-.Made.with.Clipchamp.1.mp4

💻 Operating system

Windows

🤖 Node Version

v18.17.1

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

Are you willing to submit PR?

Yes I am willing to submit a PR!

@mpatwa98
Copy link

mpatwa98 commented Oct 6, 2023

I would like to work on this. Can you assign it to me?

@ManishGupta2003
Copy link

👋 Hello there,

I've reviewed the issue and I can see that the Accordion component in the Q&A section is currently exhibiting undesirable behavior with keyboard-based navigation, as described. Each keypress appears to toggle the drawer, leading to an unstable experience.

To resolve this issue, I'm planning to implement the following changes:

  1. Disable the Accordion's response to every keypress. It should only expand and contract when specific keyboard events occur.

  2. Define keyboard shortcuts: I'll set up keyboard shortcuts, such as the Tab key to navigate between drawers, and the Escape key to close the currently open drawer.

  3. Implement the ability to close the open drawer by clicking outside the component's boundaries.

I'll work on these changes and submit a pull request to address the issue. Please feel free to provide any additional feedback or suggestions.

Thank you for bringing this to our attention, and I'll keep you updated on the progress.

Best regards,
Manish gupta

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

No branches or pull requests

3 participants