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
923 stars 377 forks source link

Custom widgets should be used in Property Grid only and should not appear as in-place editors #4196

Closed JaneSjs closed 1 year ago

JaneSjs commented 1 year ago

When third-party components are being used as inplace editors, we may not correct handle some scenarios.

For instance, when using CKEditor for editing properties of text and html types (as it's shown in this demo), the Enter key or Ctrl+Enter combination should insert a carriage return. However, when CKEditor is used in-place, Enter/Ctrl+Enter submits the value and closes the editor. image

This issue was reported at T13268 - Display Multiline Text in a Question's Title https://surveyjs.answerdesk.io/internal/ticket/details/T13268.

One more issue with using CKEditor as an inplace editor: T13305 - Enable Fast entry by default https://surveyjs.answerdesk.io/internal/ticket/details/T13305

If you copy a bullet-in list and paste it in default in-place editing mode, this will create individual choices for each list item:

https://github.com/surveyjs/survey-creator/assets/22372972/a7652a61-3154-4a21-beb7-7ad5adeb89ba

However, this feature doesn't work when CKEditor is used as an in-place editor:

https://github.com/surveyjs/survey-creator/assets/22372972/1472f71b-c82b-4a99-9984-9f365401cfb4

Therefore, using third-party widgets as in-place editors require special handling of key events. I suggest that we may not use third-party widgets as in-place editors.

JaneSjs commented 1 year ago

When the onTextMarkdown event is handled for a survey being designed, an in-place string editor is turned into an HTML content editing mode. Therefore, an HTML/markdown editor is used to edit survey texts.

It should be possible to insert a carriage return by using the Shift+Enter key combination. We'll made necessary code updates. Please track our progress at https://github.com/surveyjs/survey-creator/issues/4217.

However, when a Markdown editor is being used in-place, the complex logic is disabled. Therefore, there is no default option to create creating separate choices for list items, as it was requested at T13305 - Enable Fast entry by default.