Skip to content

Commit 70ac6cb

Browse files
author
Philipp Eichhorn
committed
feat: add wizard-body container around component s
1 parent a2c26f6 commit 70ac6cb

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/Wizard.js

+22-2
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,26 @@ export default class Wizard extends Webform {
263263
}
264264

265265
build() {
266-
super.build();
266+
// Clear any existing event handlers in case this is a rebuild
267+
this.eventHandlers.forEach(h => this.removeEventListener(h.obj, h.type));
268+
269+
const element = this.getContainer();
270+
const componentsContainer = this.ce('div', {
271+
class: 'wizard-body'
272+
});
273+
element.appendChild(componentsContainer);
274+
275+
this.on('submitButton', (options) => this.submit(false, options), true);
276+
this.on('checkValidity', (data) => this.checkValidity(null, true, data), true);
277+
this.addComponents(componentsContainer, null, null);
278+
this.currentForm = this;
279+
this.on('requestUrl', (args) => (this.submitUrl(args.url,args.headers)), true);
280+
setTimeout(() => {
281+
this.onChange({
282+
noEmit: true
283+
});
284+
}, 1);
285+
267286
this.formReady.then(() => {
268287
this.buildWizardHeader();
269288
this.buildWizardNav();
@@ -328,6 +347,7 @@ export default class Wizard extends Webform {
328347
});
329348

330349
this.wizardHeader = this.ce('nav', {
350+
class: 'wizard-header',
331351
'aria-label': 'navigation'
332352
});
333353

@@ -454,7 +474,7 @@ export default class Wizard extends Webform {
454474
return;
455475
}
456476
this.wizardNav = this.ce('ul', {
457-
class: 'list-inline pull-right'
477+
class: 'list-inline pull-right wizard-footer'
458478
});
459479
this.element.appendChild(this.wizardNav);
460480
[

0 commit comments

Comments
 (0)