From c3c4e16014f76dfe47ea6e03329fae57ce884a5f Mon Sep 17 00:00:00 2001 From: dmitrykurmanov Date: Mon, 10 Jun 2024 15:20:06 +0400 Subject: [PATCH] work for the https://github.com/surveyjs/survey-library/issues/8389 --- src/defaultV2-theme/blocks/sd-dropdown.scss | 8 +++++++ .../tests/defaultV2/dropdown.ts | 21 ++++++++++++++++++ .../dropdown-readonly-empty-placeholder.png | Bin 0 -> 422 bytes 3 files changed, 29 insertions(+) create mode 100644 visualRegressionTests/tests/defaultV2/etalons/dropdown-readonly-empty-placeholder.png diff --git a/src/defaultV2-theme/blocks/sd-dropdown.scss b/src/defaultV2-theme/blocks/sd-dropdown.scss index 719555f35b..cb8e899118 100644 --- a/src/defaultV2-theme/blocks/sd-dropdown.scss +++ b/src/defaultV2-theme/blocks/sd-dropdown.scss @@ -88,6 +88,7 @@ .sd-input.sd-dropdown:focus-within { box-shadow: $shadow-inner-reset, 0 0 0 2px $primary; } + .sd-input.sd-dropdown.sd-input--readonly { box-shadow: none; transition: none; @@ -121,6 +122,12 @@ color: $font-editorfont-placeholdercolor; } +.sd-dropdown--empty { + div { + min-height: multiply(1.5, $font-editorfont-size); + } +} + .sd-dropdown__filter-string-input::placeholder { color: $foreground; width: 100%; @@ -166,6 +173,7 @@ .sd-question--preview .sd-dropdown_chevron-button { display: none; } + .sv-dropdown-popup { .sd-list__item-body { @include useEditorFontSize; diff --git a/visualRegressionTests/tests/defaultV2/dropdown.ts b/visualRegressionTests/tests/defaultV2/dropdown.ts index 1294a2ddac..4dd186e346 100644 --- a/visualRegressionTests/tests/defaultV2/dropdown.ts +++ b/visualRegressionTests/tests/defaultV2/dropdown.ts @@ -677,4 +677,25 @@ frameworks.forEach(framework => { }); }); + test("Check dropdown readonly with empty placeholder", async (t) => { + await wrapVisualTest(t, async (t, comparer) => { + await t.resizeWindow(1280, 1100); + await initSurvey(framework, { + showQuestionNumbers: "off", + questions: [ + { + "type": "dropdown", + "name": "q1", + placeholder: "", + readOnly: true, + "choices": ["item1", "item2"] + }, + ] + }); + + const emptyDropdown = Selector(".sd-dropdown--empty.sd-input--readonly").filterVisible(); + await takeElementScreenshot("dropdown-readonly-empty-placeholder.png", emptyDropdown, t, comparer); + }); + }); + }); \ No newline at end of file diff --git a/visualRegressionTests/tests/defaultV2/etalons/dropdown-readonly-empty-placeholder.png b/visualRegressionTests/tests/defaultV2/etalons/dropdown-readonly-empty-placeholder.png new file mode 100644 index 0000000000000000000000000000000000000000..0058fba7d92f77ac7b1e410d481ef67083edf3a4 GIT binary patch literal 422 zcmeAS@N?(olHy`uVBq!ia0y~yU@`!*4LI0=vUayue6*0bN)NO^5?NYqx4_AD=GiCbob@E zmCJ!PbnmjhJ9mF+`7Z1CVT=qF%^+pr<;!<}=5%LZxVL2Y=heGEYl4_7c7M*K%r!9o zWUU37qj@cA