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
898 stars 373 forks source link

Logic tab incorrectly renders custom React questions under "set answer" #4983

Closed mgoetz-nerdery closed 9 months ago

mgoetz-nerdery commented 9 months ago

Are you requesting a feature, reporting a bug or ask a question?

Reporting a bug

What is the current behavior?

Custom React question components render incorrectly when shown under "set answer" on the Logic tab. See below.

Screenshot 2023-12-13 at 9 12 14 AM

Note that this behavior occurs in the CodeSandbox provided by the SurveyJS documentation for custom question types.

What is the expected behavior?

The component should have additional padding to the bottom and left to reflect the way it renders in the editor and in preview mode.

How would you reproduce the current behavior (if this is a bug)?

Provide the test code and the tested page URL (if applicable)

Tested page URL: https://codesandbox.io/p/sandbox/amazing-rubin-ljwkd9?file=%2Fsrc%2Findex.js

Specify your

andrewtelnov commented 9 months ago

@mgoetz-nerdery Sorry, it took a while. Here is the updated example. You will need to add the following code:

defaultV2Css[CUSTOM_TYPE] = {
  root: "",
};

Thank you, Andrew

mgoetz-nerdery commented 9 months ago

Thanks for letting me know! Would it make sense to update the documentation for custom questions to include this detail?

andrewtelnov commented 9 months ago

@mgoetz-nerdery You will not need this work-around for new version we will release shortly.

Thank you, Andrew

mgoetz-nerdery commented 9 months ago

Thanks! Let me know what the new version number is once it's ready.

andrewtelnov commented 9 months ago

@mgoetz-nerdery We have released it several hours ago.

Thank you, Andrew