surveyjs / survey-creator

Scalable open-source survey software to generate dynamic JSON-driven forms within your JavaScript application. The form builder features a drag-and-drop UI, CSS Theme Editor, and GUI for conditional logic and form branching.
https://surveyjs.io/open-source
Other
915 stars 373 forks source link

The `onMatrixColumnAdded` event is not raised when a new matrix column is added by pressing the Enter key on the design surface #5274

Closed JaneSjs closed 8 months ago

JaneSjs commented 8 months ago

T17025 - MatrixColumnAdded event not working if we try to create new column from survey design surface using enter key https://surveyjs.answerdesk.io/internal/ticket/details/T17025


View Demo

The creator.onMatrixColumnAdded event is correctly raised if you add columns via a property grid's column editor. However, this event is not invoked if you add columns by pressing Enter in a design surface. image

JaneSjs commented 8 months ago

The issue: if you add columns via a property grid, the options.columns array contains a newly added column object. However, if you add a column via the design surface, the options.columns array doesn't contain a newly added column. https://plnkr.co/edit/R5cMOt2bhpjwghMg

novikov82 commented 8 months ago

the options.columns array doesn't contain a newly added column.

This is expected behaviour. See https://github.com/surveyjs/survey-creator/blob/master/packages/survey-creator-core/src/creator-events-api.ts#L293-L296

JaneSjs commented 8 months ago

TODO: update https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#onMatrixColumnAdded