mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
fix(accordion): pass missing dividerProps to Divider (#3392)
* chore(deps): pnpm-lock.yaml * fix(accordion): pass missing `dividerProps` to Divider * chore(changeset): add issue number --------- Co-authored-by: WK Wong <wingkwong.code@gmail.com>
This commit is contained in:
parent
35e709de7d
commit
8dce94e5f0
5
.changeset/many-wasps-move.md
Normal file
5
.changeset/many-wasps-move.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@nextui-org/accordion": patch
|
||||
---
|
||||
|
||||
Pass missing `dividerProps` to Divider (#3390)
|
||||
@ -356,4 +356,23 @@ describe("Accordion", () => {
|
||||
});
|
||||
expect(input).toHaveValue("aabac");
|
||||
});
|
||||
|
||||
it("should pass dividerProps to divider", () => {
|
||||
const {getByRole} = render(
|
||||
<Accordion
|
||||
dividerProps={{
|
||||
className: "bg-rose-500",
|
||||
}}
|
||||
>
|
||||
<AccordionItem key="1" data-testid="item-1" title="Accordion Item 1">
|
||||
Accordion Item 1 description
|
||||
</AccordionItem>
|
||||
<AccordionItem key="2" data-testid="item-2" title="Accordion Item 2">
|
||||
Accordion Item 2 description
|
||||
</AccordionItem>
|
||||
</Accordion>,
|
||||
);
|
||||
|
||||
expect(getByRole("separator")).toHaveClass("bg-rose-500");
|
||||
});
|
||||
});
|
||||
|
||||
@ -19,6 +19,7 @@ const AccordionGroup = forwardRef<"div", AccordionProps>((props, ref) => {
|
||||
disableAnimation,
|
||||
handleFocusChanged: handleFocusChangedProps,
|
||||
itemClasses,
|
||||
dividerProps,
|
||||
} = useAccordion({
|
||||
...props,
|
||||
ref,
|
||||
@ -45,7 +46,7 @@ const AccordionGroup = forwardRef<"div", AccordionProps>((props, ref) => {
|
||||
{!item.props.hidden &&
|
||||
!isSplitted &&
|
||||
showDivider &&
|
||||
index < state.collection.size - 1 && <Divider />}
|
||||
index < state.collection.size - 1 && <Divider {...dividerProps} />}
|
||||
</Fragment>
|
||||
);
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user