Skip to content

Commit e2eed47

Browse files
committed
Wizard: prevent to reload Wizard on enter
In LabelInput, the Wizard requires users to press enter. Although the hostname step does not need it, users might press enter without knowing it is not needed, which previously trigerred a re-render. This commit fixes the re-render.
1 parent 8b1ff13 commit e2eed47

File tree

1 file changed

+6
-1
lines changed
  • src/Components/CreateImageWizard/steps/Hostname

1 file changed

+6
-1
lines changed

src/Components/CreateImageWizard/steps/Hostname/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ import { CustomizationLabels } from '../../../sharedComponents/CustomizationLabe
88

99
const HostnameStep = () => {
1010
return (
11-
<Form>
11+
<Form
12+
onSubmit={(event) => {
13+
// this prevents from reloading the wizard on pressing enter
14+
event.preventDefault();
15+
}}
16+
>
1217
<CustomizationLabels customization='hostname' />
1318
<Title headingLevel='h1' size='xl'>
1419
Hostname

0 commit comments

Comments
 (0)