shinokada / svelte-5-ui-lib

A UI library crafted for Svelte 5: Runes
https://svelte-5-ui-lib.codewithshin.com
MIT License
104 stars 13 forks source link

fix: fix accordionitem open state #19

Closed domlobo closed 1 month ago

domlobo commented 2 months ago

📑 Description

Couple of fixes for the accordionitem open state:

  1. Update behaviour so it collapses other AccordianItems in the same group when you click an item. I believe this is the expected behaviour and fixes the "Always Open" issue on the coverage page.
  2. Update behaviour to allow for an AccordianItem to start open - previously the item collapsed immediately even if the open parameter was set to true. Unsure if this needs a new doc example, please let me know

I've bundled the changes as they are small and related - please let me know if you would prefer multiple PRs :)

✅ Checks

ℹ Additional Information

There is some weird behaviour with the focus rings on the default style. When an AccordionItem moves to the "activeClass" it gains a focus ring - this overspills and looks slightly odd. I have not "fixed" this as it seems to be desired behaviour based on the default acitveClass. I believe this wasn't happening previously as the "activeClass" was never applying to the AccorionItem.

Let me know what you think and if you want to keep the focus-ring / change the styling: image

vercel[bot] commented 2 months ago

@domlobo is attempting to deploy a commit to the Shinichi Okada's projects Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-5-ui-lib ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 17, 2024 5:15am