From cec9622f39a31bc9e30fd4c7824a80f9e4a4cd1d Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 5 Jan 2024 09:37:18 +0200 Subject: [PATCH] Logic tab incorrectly renders new question types under "set answer" fix #4983 (#5053) --- .../src/components/tabs/logic-item-editor.ts | 2 +- packages/survey-creator-core/tests/tabs/logic.tests.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/survey-creator-core/src/components/tabs/logic-item-editor.ts b/packages/survey-creator-core/src/components/tabs/logic-item-editor.ts index b74f7ac56e..f290ea9470 100644 --- a/packages/survey-creator-core/src/components/tabs/logic-item-editor.ts +++ b/packages/survey-creator-core/src/components/tabs/logic-item-editor.ts @@ -258,7 +258,7 @@ export class LogicItemEditor extends PropertyEditorSetupValue { if (selectorsNames.indexOf(question.name) < 0 && (parentName === "triggerEditorPanel" || parentName === "setValueIfPanel")) { const qType = question.getType(); assignDefaultV2Classes(cssClasses, qType); - if(!defaultV2Css[qType]) { + if(!defaultV2Css[qType] && propertyGridCss[qType]) { copyCssClasses(cssClasses, propertyGridCss.question); copyCssClasses(cssClasses, propertyGridCss[qType]); } diff --git a/packages/survey-creator-core/tests/tabs/logic.tests.ts b/packages/survey-creator-core/tests/tabs/logic.tests.ts index 1af14b0ad6..e31bc4dae2 100644 --- a/packages/survey-creator-core/tests/tabs/logic.tests.ts +++ b/packages/survey-creator-core/tests/tabs/logic.tests.ts @@ -3180,8 +3180,9 @@ test("SurveyLogicItem, setValue css", () => { expect(panel.getQuestionByName("logicTypeName").value).toBe("trigger_setvalue"); const triggerEditorPanel = panel.getElementByName("triggerEditorPanel"); const setValueQuestion = triggerEditorPanel.getQuestionByName("setValue"); - expect(setValueQuestion.cssClasses.mainRoot.indexOf("svc-logic-question-value")).toBeTruthy(); - expect(setValueQuestion.contentQuestion.cssClasses.mainRoot.indexOf("svc-logic-question-value")).toBeTruthy(); + expect(setValueQuestion.cssClasses.mainRoot.indexOf("svc-logic-question-value") > -1).toBeTruthy(); + expect(setValueQuestion.contentQuestion.cssClasses.mainRoot.indexOf("svc-logic-question-value") > -1).toBeTruthy(); + expect(setValueQuestion.cssClasses.mainRoot.indexOf("spg-question") > -1).toBeFalsy(); ComponentCollection.Instance.clear(); }); test("Test questions css in an action panel", () => {