angular-material
angular-material copied to clipboard
[BUG] nextPage event in wizard not working
Environment
- Hosting type
- [ ] Form.io
- [x] Local deployment
- Version: 1.30.0
- Formio.js version: 4.10.3-rc.3
- Frontend framework: angular 8.2.14
Steps to Reproduce
- clone the
angular-material-formiodemo - replace the content of
app.component.htmlwith
<mat-formio [form]="form" [submission]="submission" (submit)="onSubmit($event)" (nextPage)="onNextPage()" (change)="onChange()"></mat-formio>
- edit the
app.component.tsfile to contain
form: any = {
"type": "form",
"components": [
{
"key": "panel",
"title": "Part 1",
"components": [
{
"label": "Foo",
"key": "foo",
"type": "textfield",
}
],
"type": "panel",
},
{
"key": "panel2",
"title": "Part 2",
"components": [
{
"label": "Bar",
"key": "bar",
"type": "textfield",
}
],
"type": "panel",
}
],
"display": "wizard",
"title": "Test wizard",
};
submission: any = {
"data": {
"foo": 5
}
};
onChange() {
console.log('onChange');
}
onNextPage() {
console.log('nextPage');
}
Expected behavior
When clicking the "Next" button of the sample form, a log line with the text "nextPage" should be output in the console. The event is documented in the wiki.
Observed behavior
No log line, it looks like the event is not emitted by the mat-formio component.
The (change) event works well and the onChange log line appears.
I tried to use the non-material formio component with the angular-demo app and the event works there.
I tried to find out where the issue lies:
- the
MaterialWizardComponentcomponent has anextPage()function which is called https://github.com/formio/angular-material-formio/blob/fb0035557f910367d774d5c4918074f208ac04eb/projects/angular-material-formio/src/lib/components/formio.wizard.ts#L48 - the
Wizardclass of theformio.jslibrary has anextPagemethod but I couldn't verify that it is called https://github.com/formio/formio.js/blob/e419302e8054c244f6e575841ea77b3a2e4e005c/src/Wizard.js#L604
My experience in debugging Angular apps is very limited, so if anyone has a hint on where to start I would be very thankful!