Skip to content

Commit b2133b5

Browse files
author
Eric Olkowski
committed
Updated examples to use ActionList in custom footers
1 parent 6367276 commit b2133b5

File tree

4 files changed

+40
-16
lines changed

4 files changed

+40
-16
lines changed

packages/react-core/src/components/Wizard/Wizard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const Wizard = ({
7777
onStepChange,
7878
onSave,
7979
onClose,
80-
shouldFocusContent = false,
80+
shouldFocusContent = true,
8181
...wrapperProps
8282
}: WizardProps) => {
8383
const [activeStepIndex, setActiveStepIndex] = React.useState(startIndex);

packages/react-core/src/components/Wizard/examples/Wizard.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ import layout from '@patternfly/react-styles/css/layouts/Bullseye/bullseye';
6565

6666
To focus the main content element of the `Wizard`, pass in the `shouldFocusContent` property. It is recommended that this is passed in so that users can navigate through a `WizardStep` content in order.
6767

68-
If a `WizardStep` is passed a `body={null}` property, you must manually handle focus.
69-
7068
```ts file="./WizardFocusOnNextBack.tsx"
7169

7270
```

packages/react-core/src/components/Wizard/examples/WizardValidateOnButtonPress.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import React from 'react';
22

33
import {
44
Button,
5+
ActionList,
6+
ActionListGroup,
7+
ActionListItem,
58
Alert,
69
EmptyState,
710
EmptyStateFooter,
@@ -96,10 +99,18 @@ const LastStepFooter: React.FunctionComponent<LastStepFooterProps> = ({
9699

97100
return (
98101
<WizardFooterWrapper>
99-
<Button onClick={onValidate}>Validate</Button>
100-
<Button variant="secondary" onClick={goToPrevStep}>
101-
Back
102-
</Button>
102+
<ActionList>
103+
<ActionListGroup>
104+
<ActionListItem>
105+
<Button variant="secondary" onClick={goToPrevStep}>
106+
Back
107+
</Button>
108+
</ActionListItem>
109+
<ActionListItem>
110+
<Button onClick={onValidate}>Validate</Button>
111+
</ActionListItem>
112+
</ActionListGroup>
113+
</ActionList>
103114
</WizardFooterWrapper>
104115
);
105116
};

packages/react-core/src/components/Wizard/examples/WizardWithCustomFooter.tsx

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import React from 'react';
22

33
import {
4+
ActionList,
5+
ActionListGroup,
6+
ActionListItem,
47
Button,
58
Flex,
69
FlexItem,
@@ -40,15 +43,27 @@ const CustomStepTwoFooter = () => {
4043

4144
return (
4245
<WizardFooterWrapper>
43-
<Button variant="secondary" onClick={goToPrevStep} isDisabled={isLoading}>
44-
Back
45-
</Button>
46-
<Button variant="primary" onClick={onNext} isLoading={isLoading} isDisabled={isLoading}>
47-
Async Next
48-
</Button>
49-
<Button variant="link" onClick={close} isDisabled={isLoading}>
50-
Cancel
51-
</Button>
46+
<ActionList>
47+
<ActionListGroup>
48+
<ActionListItem>
49+
<Button variant="secondary" onClick={goToPrevStep} isDisabled={isLoading}>
50+
Back
51+
</Button>
52+
</ActionListItem>
53+
<ActionListItem>
54+
<Button variant="primary" onClick={onNext} isLoading={isLoading} isDisabled={isLoading}>
55+
Async Next
56+
</Button>
57+
</ActionListItem>
58+
</ActionListGroup>
59+
<ActionListGroup>
60+
<ActionListItem>
61+
<Button variant="link" onClick={close} isDisabled={isLoading}>
62+
Cancel
63+
</Button>
64+
</ActionListItem>
65+
</ActionListGroup>
66+
</ActionList>
5267
</WizardFooterWrapper>
5368
);
5469
};

0 commit comments

Comments
 (0)