Skip to content

Commit cd3c03a

Browse files
committed
fix(pf4): fix wizard navigation buttons to not submit forms
1 parent d3197eb commit cd3c03a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ const WizardNavigationInternal = React.memo(
3636
isDisabled={isValid ? maxStepIndex < step.index : step.index > activeStepIndex}
3737
onNavItemClick={(ind) => jumpToStep(ind, isValid)}
3838
step={step.index}
39+
type="button"
3940
>
4041
{substeps && (
4142
<WizardNav returnList>
4243
{substeps.map((substep) => (
4344
<WizardNavItem
45+
type="button"
4446
key={substep.name}
4547
content={substep.title}
4648
isCurrent={activeStepIndex === substep.index}

packages/pf4-component-mapper/src/tests/wizard/__snapshots__/wizard.test.js.snap

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@ exports[`<Wizard /> should render correctly and unmount 1`] = `
643643
key="1"
644644
onNavItemClick={[Function]}
645645
step={0}
646+
type="button"
646647
>
647648
<li
648649
className="pf-c-wizard__nav-item"
@@ -653,6 +654,7 @@ exports[`<Wizard /> should render correctly and unmount 1`] = `
653654
className="pf-c-wizard__nav-link pf-m-current"
654655
disabled={false}
655656
onClick={[Function]}
657+
type="button"
656658
>
657659
foo-step
658660
</button>
@@ -665,6 +667,7 @@ exports[`<Wizard /> should render correctly and unmount 1`] = `
665667
key="2"
666668
onNavItemClick={[Function]}
667669
step={1}
670+
type="button"
668671
>
669672
<li
670673
className="pf-c-wizard__nav-item"
@@ -675,6 +678,7 @@ exports[`<Wizard /> should render correctly and unmount 1`] = `
675678
className="pf-c-wizard__nav-link pf-m-disabled"
676679
disabled={true}
677680
onClick={[Function]}
681+
type="button"
678682
>
679683
bar-step
680684
</button>
@@ -1723,6 +1727,7 @@ exports[`<Wizard /> should render correctly in modal and unmount 1`] = `
17231727
<button
17241728
aria-current="page"
17251729
class="pf-c-wizard__nav-link pf-m-current"
1730+
type="button"
17261731
>
17271732
foo-step
17281733
</button>
@@ -1735,6 +1740,7 @@ exports[`<Wizard /> should render correctly in modal and unmount 1`] = `
17351740
aria-disabled="true"
17361741
class="pf-c-wizard__nav-link pf-m-disabled"
17371742
disabled=""
1743+
type="button"
17381744
>
17391745
bar-step
17401746
</button>
@@ -1890,6 +1896,7 @@ exports[`<Wizard /> should render correctly in modal and unmount 1`] = `
18901896
<button
18911897
aria-current="page"
18921898
class="pf-c-wizard__nav-link pf-m-current"
1899+
type="button"
18931900
>
18941901
foo-step
18951902
</button>
@@ -1902,6 +1909,7 @@ exports[`<Wizard /> should render correctly in modal and unmount 1`] = `
19021909
aria-disabled="true"
19031910
class="pf-c-wizard__nav-link pf-m-disabled"
19041911
disabled=""
1912+
type="button"
19051913
>
19061914
bar-step
19071915
</button>
@@ -2179,6 +2187,7 @@ exports[`<Wizard /> should render correctly in modal and unmount 1`] = `
21792187
key="1"
21802188
onNavItemClick={[Function]}
21812189
step={0}
2190+
type="button"
21822191
>
21832192
<li
21842193
className="pf-c-wizard__nav-item"
@@ -2189,6 +2198,7 @@ exports[`<Wizard /> should render correctly in modal and unmount 1`] = `
21892198
className="pf-c-wizard__nav-link pf-m-current"
21902199
disabled={false}
21912200
onClick={[Function]}
2201+
type="button"
21922202
>
21932203
foo-step
21942204
</button>
@@ -2201,6 +2211,7 @@ exports[`<Wizard /> should render correctly in modal and unmount 1`] = `
22012211
key="2"
22022212
onNavItemClick={[Function]}
22032213
step={1}
2214+
type="button"
22042215
>
22052216
<li
22062217
className="pf-c-wizard__nav-item"
@@ -2211,6 +2222,7 @@ exports[`<Wizard /> should render correctly in modal and unmount 1`] = `
22112222
className="pf-c-wizard__nav-link pf-m-disabled"
22122223
disabled={true}
22132224
onClick={[Function]}
2225+
type="button"
22142226
>
22152227
bar-step
22162228
</button>

0 commit comments

Comments
 (0)