themesberg / themesberg/flowbite

Incorrect toggling of custom classes in accordions

Open
#1,005 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
9.4k
Forks
862
PR merge metrics
No merged PRs in 30d

Description

When an accordion item is expanded, classes in data-active-classes are removed if they are also present in data-inactive-classes. This is a problem when you want the same classes applied for both when the accordion is open & and when it's closed.

Steps to reproduce:

  1. Add an accordion component from the docs
  2. Set data-active-classes="foo bar foobar" and data-inactive-classes="foo bar barfoo" on the accordion container element
  3. Toggle the accordion
  4. Classes foo and bar are removed from the accordion toggle

Expected behavior
All classes in data-active-classes should be present when the accordion is open and all classes in data-inactive-classes should be present when the accordion is closed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the accordion component referenced in the docs as the entry point, and reproduce the case where data-active-classes and data-inactive-classes overlap. Trace the class toggling for the accordion toggle; done means shared classes remain present in both open and closed states while each state’s other classes are applied.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, tailwindcss
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.