Skip to content

Commit 7061c52

Browse files
committed
fix(pf4): allow to set container in wizard
1 parent 899f399 commit 7061c52

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

packages/pf4-component-mapper/src/files/wizard.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ const WizardInternal = ({
4343
navSchema,
4444
activeStepIndex,
4545
maxStepIndex,
46-
isDynamic
46+
isDynamic,
47+
container
4748
}) => {
48-
const [state, dispatch] = useReducer(reducer, { loading: true });
49+
const [state, dispatch] = useReducer(reducer, { loading: true, container });
4950

5051
useEffect(() => {
5152
if (inModal) {

packages/pf4-component-mapper/src/files/wizard/reducer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const reducer = (state, { type }) => {
66
loading: false
77
};
88
case 'setContainer':
9-
return { ...state, container: document.createElement('div') };
9+
return { ...state, container: state.container || document.createElement('div') };
1010
default:
1111
return state;
1212
}

packages/react-renderer-demo/src/app/src/doc-components/pf4-wizard.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Don't forget hide form controls by setting \`showFormControls\` to \`false\` as
1010
| description | string | undefined | Description in header |
1111
| buttonLabels | object | see below | Labels for buttons |
1212
| inModal | bool | undefined | show form in modal |
13+
| container | HTMLElement | 'div' | element containing the modal |
1314
| isCompactNav | bool | undefined | see Patternfly |
1415
| setFullWidth | bool | undefined | see Patternfly |
1516
| setFullHeight | bool | undefined | see Patternfly |

0 commit comments

Comments
 (0)