From b00d1b6cd3cfc36407e5cf29717c0332523da906 Mon Sep 17 00:00:00 2001 From: Serhii Kulykov Date: Mon, 2 Sep 2024 10:47:04 +0300 Subject: [PATCH] fix: do not apply checkbox readonly background when disabled (#7733) --- .../checkbox/test/visual/lumo/checkbox.test.js | 12 ++++++++++++ .../baseline/disabled-readonly-checked.png | Bin 0 -> 1207 bytes .../baseline/disabled-readonly-indeterminate.png | Bin 0 -> 1122 bytes .../test/visual/material/checkbox.test.js | 12 ++++++++++++ .../baseline/disabled-readonly-checked.png | Bin 0 -> 1118 bytes .../baseline/disabled-readonly-indeterminate.png | Bin 0 -> 1007 bytes .../theme/lumo/vaadin-checkbox-styles.js | 4 ++-- .../theme/material/vaadin-checkbox-styles.js | 6 +++--- 8 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 packages/checkbox/test/visual/lumo/screenshots/checkbox/baseline/disabled-readonly-checked.png create mode 100644 packages/checkbox/test/visual/lumo/screenshots/checkbox/baseline/disabled-readonly-indeterminate.png create mode 100644 packages/checkbox/test/visual/material/screenshots/checkbox/baseline/disabled-readonly-checked.png create mode 100644 packages/checkbox/test/visual/material/screenshots/checkbox/baseline/disabled-readonly-indeterminate.png diff --git a/packages/checkbox/test/visual/lumo/checkbox.test.js b/packages/checkbox/test/visual/lumo/checkbox.test.js index fe6ce9035f..a84b068bdf 100644 --- a/packages/checkbox/test/visual/lumo/checkbox.test.js +++ b/packages/checkbox/test/visual/lumo/checkbox.test.js @@ -92,6 +92,18 @@ describe('checkbox', () => { await visualDiff(div, 'disabled-required'); }); + it('readonly checked', async () => { + element.readonly = true; + element.checked = true; + await visualDiff(div, 'disabled-readonly-checked'); + }); + + it('readonly indeterminate', async () => { + element.readonly = true; + element.indeterminate = true; + await visualDiff(div, 'disabled-readonly-indeterminate'); + }); + describe('styled', () => { before(() => { document.documentElement.style.setProperty('--vaadin-checkbox-disabled-checkmark-color', 'white'); diff --git a/packages/checkbox/test/visual/lumo/screenshots/checkbox/baseline/disabled-readonly-checked.png b/packages/checkbox/test/visual/lumo/screenshots/checkbox/baseline/disabled-readonly-checked.png new file mode 100644 index 0000000000000000000000000000000000000000..7f4531fd8d4533ec3cb95c35e05b08a5dcfa2502 GIT binary patch literal 1207 zcmai!{W}u~0LQm0FU#D}n|Y}$tCkq$C7!fGF)=ly(WG!Ews5M++gK&3^EL|M5aH&f zGma%Tw%fdnN1V52?pSEFaTBw!o&TU8zTeODdA`4YpI*keYVR`G1polF(QYo-ZIZWh zQd51q@5S#d+XgTO>*@rkA21RF06U}6F6Vt>izJ0YubFE`=Q0fu;L4}S5 zQk+EHEf9jZ5mb?ok}Xra*t=iDKC&r>P`sT4Hwm$ITFY#9hE%&5z$ae}N&7Hwv zCzikoqh$nIIk<a8Eza;@`vK~&nb1;MQkh-V_&_IW zEVwaRjxx0_cB*-5kH1=;K`ei@mIsalR+B4b^KhNK*vG_+r+=(PZTkHY9??3be6LlV z{ioP!62tB%d&e~)@8^Q!ri~dsJ~KCMVGI2<&0g&InrGd!F;M{I5-Yeml03caQ5je> zgj+0)F=+XMF#Bj3GMGwS;*V@}@yv}y+oM=#^+DLz$kkl1zsd3cEI^X9-6!}%Gdtea zab-aS#BheS>X0K4?=*Z_;Hg3g8y|+EP@G6q~XBRp#rpZfk2h`rg|lCL#SpM9@IPn7xqnd1Vhsk_+)c zygVZ~aRb_Bw6E-{1CQWI9Wvlf<#f&9o^R^VvBh`#CYuBM7dfwd`G#Ieky#85MVcos0hc4b5s{@=aeu_yDGk2@%y6x|GW3?FuB9MYkIGM!cJYzqXGdp z#P00SkJ`!_lC%5ai8G)3UjBJi^XzwWTb`|rjg5lfr2E%w8BhM2@QAxdBtBuu4<_ZK z;u4zs4tRWIb?eeM2&!qEh(#*R+B5n3?2mW9&ba&kf$e-&4eQ%a$~J3QceYJeNzs0H zTxOkla)q^@$&W-uee(lSoo~PG-yQep;BjH|LitHQj)>J;?e@3%@#dfVBfCR8wzVdz ze|B4MociPHqKos7)%^RPwASwXU%_;r^EsD$rmU=4Cw6j~xo+Z(ISse-6H6W}s_K-} zDtjv?=kYOlgXE)X+aABXm96PplQnC6%pCq`9^Td*WfvX$q>g*BF=w3)C-=nX1x2Nv zhQjL%8a-}Y=iDa zHBR;L{j>l7&+?^J^?!f9oNL=(_^vGQe0a^nyxDF)dG@Y)pq_C3%9}f%mA*wwn6tmQ z`gp;?hPKRulPj2|mhnC{{&L*)-FFE+>DBiaU5gdD_A=)8+tqc|*SD>hX>*;sb;EJq zr?3doF z;L*uL417N$nx6I6dllqLFAwRAx*k|~@zs2mm`OS3ww})t^(&C5>@S{CP$c?Q<)T&p z=UE?)$~9mAY<_dHxJUaHo&SHu{>mL&tzKHaKJwTUL1CH8Q8gi-=2veo2&zn;n7=Ra z&c`H;fT?qLPLegMEXZ3fVjS$Yq9*3XS<7$UAMU@Ml60)TeNEWIBRR<|iK=h!q%kM$ zJ7gzp!yjh;|9ZvSj2*Xr-eJ5F^8Aa?zhw{KUH`I=G4KBNjqBOhcHi?7pX+$9XvrRYhnf>v z=`jh(GrGAS+*nd+TkJ&$m8z9(?`NvUOVX8AkES_NY_ar)QV`j*gDjz80b}Cw|fQ zXo=4scZGDu{MzFhw)=^(n5l8enXWH|Co)B)o|(F-Yn;k{;qGm9TIAyCWxa!c%3?21~8lQvdv>F;8_M8AAK9+T{__?>({xBvU~3uom@c~!aZz48AQZ(Dii z`|nfd=JIj>bgA`tBz*gA{Ry@6B}KbG<>k#ivaM! { element.required = true; await visualDiff(div, 'disabled-required'); }); + + it('readonly checked', async () => { + element.readonly = true; + element.checked = true; + await visualDiff(div, 'disabled-readonly-checked'); + }); + + it('readonly indeterminate', async () => { + element.readonly = true; + element.indeterminate = true; + await visualDiff(div, 'disabled-readonly-indeterminate'); + }); }); describe('RTL', () => { diff --git a/packages/checkbox/test/visual/material/screenshots/checkbox/baseline/disabled-readonly-checked.png b/packages/checkbox/test/visual/material/screenshots/checkbox/baseline/disabled-readonly-checked.png new file mode 100644 index 0000000000000000000000000000000000000000..01d7c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miY{|+Mry{-dl$W@dDovcQ{I-JWufp5=e_AUo zS<&AY!und1`9b*Y|2HZtDt=r#^8New`TLeddWM^5|2*tfn{e#*`O_VNDuSgGw`=aY z{&s^VL;3HTuC%Fg$29ie2>bm$$Oc6;Ai zW(#}!{MxmPt)ouw-?=kWHIU=r`}_NE`@McK;acYXkMAGvJDF_gx9_OMPqD{OqI)Li d3XnpAF#k+@O1TaS?83{1ORH666gQ` literal 0 HcmV?d00001 diff --git a/packages/checkbox/test/visual/material/screenshots/checkbox/baseline/disabled-readonly-indeterminate.png b/packages/checkbox/test/visual/material/screenshots/checkbox/baseline/disabled-readonly-indeterminate.png new file mode 100644 index 0000000000000000000000000000000000000000..135d6b13faedefd92720af2d6b0736b5eab24ad5 GIT binary patch literal 1007 zcmeAS@N?(olHy`uVBq!ia0vp^^+2q{!3HFKmZy6GDaPU;cPEB*=VV?oFfgz5ba4!+ znDchFZvJa4iH7;brH$-rtUN4L3Bd`83%14!M7)?U7BM5+CBc)}8n!LdIsNds1^<>SrMrJJd@ZQ;vpF|q%3&M(-gvdir~m!$K0Z_Q znCF!sW!L(vlBX^?#!a{wG+k6|Li$W;kL5@7r?1ZVv1jw%3eygDfuM!md;aSxUS|Dy zQScv2V~F>alRdw*>UPF7{t-);dD1QWk-5|5qEY!m{>Ib#zjH57Eh;=?)8LTSe)^pC z;Zqg~`;&6Evp4LykaF^4#P&t~XKr7cGW9M`!?`0GA)9!6kIUuq$4+rdSE;`K*=e%b z@?$fm-+W?kYx~#i-=9A=*F)kTo#DD7wD$AAgWF!{ES!9MLRK%^2focl9ZQ|M{A^m? z)Mr20xMS~HwgtIw;*!3U9uG5Vb$e~cx$5kVxe4miGgNP=IE6YbG+uH^q|`H2)u};1 z$m91D3;F5$KdBptP41ax@IG#Xg~r==yuIpAS!avC_?OAO@; zTd?ZO|Asv;Rv*yIecN#K{rjzK%oDbyoD45wS#-a*=5|4WhybVNg)Q@RUJ7sZm&lgB zrDOSeReN^EkCv2)%->ocA207WHob3`XnuUQv*MGJHyq*?Oy|m6oxjKXLj`-Ll7J^y z#4P1_Bj0V&?Z)~YPlZ%@uqp3$@TN#<)VZBe6z))PH8Ts8CDTYd9b`+jFd*ZPtr z*%9YwGVEXW@A$d-(|)d(I+EOD{j#r6z5d2Z{Xbd1D_2Hnb-tLrXW`3xG3^T(@ANJ; zd8}uve<5@8+i(6QZ`*I5j;onbUb1)pv4SAUetY|HReK}-$*1>ORKEK+>-O#2C%?Nr zOWyS7`0?YOLahRK?%(&HYi6W8`E=crUpu?