From b8b9115554ae08c96b5fdf5d01b262069e52600e Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 5 Feb 2024 10:28:23 +0400 Subject: [PATCH] Fix row gap in compact mode (#7803) * Fix row-gap in compact mode * Add vr test --- src/defaultV2-theme/blocks/sd-row.scss | 17 ++++--- .../etalons/row-multiple-compact-mode.png | Bin 0 -> 11265 bytes .../tests/defaultV2/survey.ts | 43 ++++++++++++++++++ 3 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 visualRegressionTests/tests/defaultV2/etalons/row-multiple-compact-mode.png diff --git a/src/defaultV2-theme/blocks/sd-row.scss b/src/defaultV2-theme/blocks/sd-row.scss index 6b882566fe..9eaab695e3 100644 --- a/src/defaultV2-theme/blocks/sd-row.scss +++ b/src/defaultV2-theme/blocks/sd-row.scss @@ -20,17 +20,17 @@ .sd-page__title, .sd-page__description { - &~.sd-row.sd-page__row:not(.sd-row--compact) { + & ~ .sd-row.sd-page__row:not(.sd-row--compact) { margin-top: calcSize(3); } - &~.sd-page__row.sd-row--compact { + & ~ .sd-page__row.sd-row--compact { margin-top: var(--sd-base-vertical-padding); } } .sd-row.sd-page__row:not(.sd-row--compact) { - &~.sd-row.sd-page__row:not(.sd-row--compact) { + & ~ .sd-row.sd-page__row:not(.sd-row--compact) { margin-top: calcSize(2); } } @@ -41,7 +41,7 @@ width: calc(100% + var(--sd-base-padding)); flex-wrap: wrap; - &>div { + & > div { box-sizing: border-box; padding-left: calcSize(2); display: flex; @@ -53,14 +53,14 @@ .sd-row--multiple { row-gap: var(--sd-base-vertical-padding); - &>div { + & > div { padding-left: var(--sd-base-padding); } } } .sd-row--multiple.sd-row--compact { - &>div { + & > div { padding-left: var(--sd-base-padding); } } @@ -69,13 +69,12 @@ margin-left: calcSize(-2); width: calc(100% + 2 * var(--sjs-base-unit, var(--base-unit, 8px))); - &.sd-row--compact { padding: 0; + row-gap: var(--sd-base-vertical-padding); margin-left: calc(-1 * var(--sd-base-padding)); width: calc(100% + var(--sd-base-padding)); } - } .sd-row__panel { @@ -87,4 +86,4 @@ box-sizing: border-box; width: 100%; white-space: nowrap; -} \ No newline at end of file +} diff --git a/visualRegressionTests/tests/defaultV2/etalons/row-multiple-compact-mode.png b/visualRegressionTests/tests/defaultV2/etalons/row-multiple-compact-mode.png new file mode 100644 index 0000000000000000000000000000000000000000..ebe0b95ac55a7139d882c1e06d4e455ace8d9dff GIT binary patch literal 11265 zcmeHtXH-<%wkCpzB7!1E1j!URNEDDzDhd=?P*M>j=bW>Mpk%5F3dwpXKn^)WK>)>2=@HqetI&@9iG%2a8&1uC?c!Yp?lzbBC#`%HJZTB_$vrxCK#o zu0cRRm`6ZxCHDF?pv4w0Gggk%x%InH1Z9qQ(0T24Jw)Ty}iE7_?>1gBJ!`QrG zEW=8Z?$MTSoAH~w9Pmadu42BVihj@sp*AByRMog_*ivg7tS_cvbQgw_i!^OhD)EwniH{NT4h`AF)IVzSu(4AJ zXgJt`(18PL!$A-@RnFVXviLvCKQ%x#9E)#fVQrKp+mL8@`Psvr6}y&`meCb7b@KsLs9&0w$@=FkJWX-@STGz_oXKs6Tp98+8($xo) zB1~7WJaQ@)IqJSc?#Y6`wm-gPDs{%Pm_NVH_dvJN*U9NqTAiT9a^+V37gbuJ6iv?F z*Y{CHIq3yyw|-ERBj$!3JzOHC8?Nyq*{3AF&!~d%{t$<$x-%Yqw$?Q7cdhjo7tSrS zKg<1A8>^|;3MdeO!pQqd5JrGIZ zA5u_|Z@2N_jalAvZ*Tg_;j>3v-N|&Q^#b`ETSwe{8~J&jEzj6VC>KLP5pI8PUPu9b zjm{T$Bkj1b9yCYPWuVdrb;mZ8qrOK1*)_a6S zF$pu>QuuB0n#UE}3hRbGjFT}VA|s*IG)w2m$g{Y^i*Q8@}rkZkRsu%l(YjeRh)^^!eWS+mWunl5uT zxXe>Uy|OyF&=LB=+eXZPBHhx)=V4>2cmIO3hr8VZY#g&IQyVpys2jb`qroeCt!>Ct z-HIX8QjL{D>XZpf!vt*|<9X>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PCU-9wk5I^g`_3PAh^gv9xyPzdj< zqk0SS9U~*j_I4X$yj-OSY~F~^u!C`Us1J_0O!i#nmQX7%!#@I{H4wO49i;{~hb}Oh z1q7r4K|c_s^+$2T6mCCbidVc$0|G+;pmBL^E8e->>F+Nht~1A~X6x$cOh*FQC$|hm zAOm>k8B?M%T$vpRLH`_D4J5CCG-RT(iyRPVqWgdyb_1!x%T6WdsLP}w>@o&{^hdG& iy%hN`CTI16#3V`iHD_)1ci@{|0>}&1=LOH+y!$sCQY_g3 literal 0 HcmV?d00001 diff --git a/visualRegressionTests/tests/defaultV2/survey.ts b/visualRegressionTests/tests/defaultV2/survey.ts index dcfe6217ff..000e9271dc 100644 --- a/visualRegressionTests/tests/defaultV2/survey.ts +++ b/visualRegressionTests/tests/defaultV2/survey.ts @@ -1287,6 +1287,49 @@ frameworks.forEach(framework => { }); }); + test("Check multiple row in compact mode", async (t) => { + await wrapVisualTest(t, async (t, comparer) => { + await t.resizeWindow(700, 1080); + const json = { + pages: [ + { + name: "p1", + elements: [ + { + type: "text", + name: "q1", + title: "Question", + startWithNewLine: false + }, + { + type: "text", + name: "q2", + title: "Question", + startWithNewLine: false + }, + { + type: "text", + name: "q3", + title: "Question", + startWithNewLine: false + }, + { + type: "text", + name: "q4", + title: "Question", + startWithNewLine: false + }, + ] + }, + ] + }; + + await initSurvey(framework, json); + await ClientFunction(() => (window as any).survey.isCompact = true)(); + await takeElementScreenshot("row-multiple-compact-mode.png", Selector(".sd-root-modern"), t, comparer); + }); + }); + test("Check survey logo right with empty title", async (t) => { await wrapVisualTest(t, async (t, comparer) => { await t.resizeWindow(1920, 1080);