File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,17 @@ describe('Basic assertions', function () {
1616 cy . percySnapshot ( )
1717 } )
1818
19+ it ( 'keeps wide images correctly sized with global CSS reset rules' , function ( ) {
20+ cy . document ( ) . then ( ( doc ) => {
21+ const style = doc . createElement ( 'style' )
22+ style . textContent = 'img, video { max-width: 100%; }'
23+ doc . head . appendChild ( style )
24+ } )
25+
26+ cy . get ( 'img' ) . should ( 'have.css' , 'width' , '1000px' )
27+ assertCssNumberCloseTo ( 'img' , 'height' , 523.546875 )
28+ } )
29+
1930 it ( 'Display tall images and set the image and cropper with correct dimension' , function ( ) {
2031 cy . visit ( '/?img=/images/cat.jpeg' )
2132 cy . get ( 'img' ) . should ( 'have.css' , 'width' , '338.4375px' )
Original file line number Diff line number Diff line change 1616.reactEasyCrop_Image ,
1717.reactEasyCrop_Video {
1818 will-change : transform; /* this improves performances and prevent painting issues on iOS Chrome */
19+ max-width : unset; /* prevent global img/video reset rules from constraining the cropper media */
1920}
2021
2122.reactEasyCrop_Contain {
You can’t perform that action at this time.
0 commit comments