-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for arrays of active event keys to Accordion (#1286)
* Add support for arrays of active event keys to Accordion * Add misc CSS things Nat wants * Fix css logic * Fix CSS to avoid doubling the top border
- Loading branch information
Showing
5 changed files
with
122 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { AccordionEventKey } from 'react-bootstrap/esm/AccordionContext'; | ||
|
||
export function isEventKeyActive(eventKey: string | null | undefined, | ||
activeEventKey: AccordionEventKey) { | ||
if (!eventKey) return false; | ||
|
||
return (Array.isArray(activeEventKey) && activeEventKey.includes(eventKey)) || | ||
eventKey === activeEventKey; | ||
} |