-
-
Notifications
You must be signed in to change notification settings - Fork 455
fix(accordion): expand/collapse through isOpen prop #775
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@rluders , I worked on this one but now I'm thinking: seems that Flowbite-React never wanted to expose |
Marked as bug and feature. @tulup-conner , what you think about this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refer to the contributing guide. Specifically, you need to make sure your PR passes the CI before submitting for review. It looks like you are not using prettier or are with a custom config. In the future, simply running
yarn format && yarn lint && yarn test && yarn build
Before you submit your changes will save a lot of time.
The changes look good overall you just did some weird stuff with Sidebar for some reason that fails the formatting check. Just undo that and the other stuff I mentioned and we will test this out.
When the CI checks pass and you've made the aforementioned changes just set this to Ready for review or, if you can't do that (I'm not sure) feel free to mention me again and I will check it out
@@ -92,7 +92,6 @@ describe('Components / Accordion', () => { | |||
render( | |||
<> | |||
<TestAccordion /> | |||
{/* eslint-disable-next-line jsx-a11y/role-has-required-aria-props */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you run yarn lint
to confirm this works? The comment is there for a reason - <button>
s are only supposed to have role="button"
. This test should just be rewritten to make this ESLint warning not come up in the first place but, otherwise, you'll need to restore this line.
src/components/Sidebar/index.ts
Outdated
export type { SidebarCollapseProps } from './SidebarCollapse'; | ||
export type { SidebarCTAProps } from './SidebarCTA'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused if you have a custom prettier config somehow or have just made these changes of your own accord, but they fail yarn prettier
so you need to revert them. I'm not sure why they were made anyway in a PR for the Accordion
@@ -1,4 +1,4 @@ | |||
import type { Meta, StoryFn } from '@storybook/react'; | |||
import type { Meta, Story } from '@storybook/react/types-6-0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please restore this change, see storybookjs/storybook#14190
@@ -266,15 +265,31 @@ describe('Components / Accordion', () => { | |||
expect(content()[1]).not.toBeVisible(); // content should not be visible | |||
}); | |||
}); | |||
|
|||
describe('Collapse/expand panel', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please just collapse this into a single test like
should collapse panel if isOpen
and expand if not after a user toggle event
Instead of introducing a beforeEach
here
Thank you @tulup-conner and sorry for replying after so long. Was kinda busy during last weeks. I checked and you were right. I had some custom configs on my VSCode. I have also analysed every point you've mentioned. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #775 +/- ##
==========================================
- Coverage 99.54% 99.54% -0.01%
==========================================
Files 129 129
Lines 6539 6538 -1
Branches 391 392 +1
==========================================
- Hits 6509 6508 -1
Misses 30 30
☔ View full report in Codecov by Sentry. |
@tulup-conner also sorry for bad commiting type. I will be more precise and I'll re-read again the contribution guide to give the best following the contribuition rules. |
@IuriPires could you please, instead merge the |
Done :) |
@IuriPires I think that it isn't actually working as expected, or there is something wrong, check it here: https://flowbite-react-3hzdjhhhs-themesberg.vercel.app/docs/components/accordion (ps: also the docs sidebar isn't working after the change) |
Hi there @rluders , could you confirm a thing? Main isn't work on my local env. I'm currently using node v18.15.0 (not building/serving Storybook) could you confirm this please? I've checkout older branches and it worked fine. |
Sorry, @IuriPires just had time to reply to you now. So... Not sure what is happening. I'm using node |
@IuriPires I think that this one just needs a rebase, right? |
Or maybe not... 🤔 |
any progress on this? |
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
It fixes #735
Fixes # (735)
Type of change
Please delete options that are not relevant.
Breaking changes
Please document the breaking changes if suitable.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: