Skip to content

Commit

Permalink
Laura's notes
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-cedrone-cengage committed Oct 18, 2023
1 parent fa75dc8 commit b59d25c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ describe('Dropdown', () => {
<DropdownExpandableMenuButton>
Pasta
</DropdownExpandableMenuButton>
<DropdownExpandableMenuPanel testId="pancakes">
<DropdownExpandableMenuPanel testId={expandablePanelId}>
<DropdownExpandableMenuListItem>
Fresh
</DropdownExpandableMenuListItem>
Expand Down Expand Up @@ -999,7 +999,7 @@ describe('Dropdown', () => {

fireEvent.click(getByText('Expandable Items Dropdown'));

expect(getByTestId('pancakes')).toBeInTheDocument();
expect(getByTestId(expandablePanelId)).toBeInTheDocument();

expect(queryByTestId(expandablePanelTwoId)).not.toBeInTheDocument();
});
Expand Down
10 changes: 6 additions & 4 deletions website/react-magma-docs/src/pages/api/dropdown.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,13 @@ export function Example() {
}
```

## Expandable Menu Items Default Index
### Expandable Menu with item auto expanded

The `defaultIndex` prop uses an array of zero based indices to enable an expandable group to be automatically opened.
By default, the `isMulti` prop is true on `DropdownExpandableMenuGroup`, which means that the expandable dropdown will allow multiple items to be expanded at once. If you wish to limit the number of items open at once, you can set the `isMulti` prop to false.

If the `isMulti` prop is set to `false`, the `defaultIndex` prop will take a single number, instead of an array.
The `defaultIndex` prop on `DropdownExpandableMenuGroup` uses an array of zero based indices to enable expandable groups to be automatically opened.

When the `isMulti` prop is false, the `defaultIndex` prop will take a single number, instead of an array.

```tsx
import React from 'react';
Expand Down Expand Up @@ -497,7 +499,7 @@ export function Example() {
}
```

## Text only Expandable Menu Item
### Text only Expandable Menu Item

```tsx
import React from 'react';
Expand Down

0 comments on commit b59d25c

Please sign in to comment.