Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix primefaces#2739: Accordion respect activeIndex
Browse files Browse the repository at this point in the history
melloware committed Apr 12, 2022
1 parent c6e196f commit 298570e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/lib/accordion/Accordion.js
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ export const AccordionTab = () => { }

export const Accordion = React.forwardRef((props, ref) => {
const [idState, setIdState] = React.useState(props.id);
const [activeIndexState, setActiveIndexState] = React.useState(null);
const [activeIndexState, setActiveIndexState] = React.useState(props.activeIndex);
const activeIndex = props.onTabChange ? props.activeIndex : activeIndexState;

const shouldUseTab = (tab) => tab && tab.props.__TYPE === 'AccordionTab';

0 comments on commit 298570e

Please sign in to comment.