This repository was archived by the owner on Sep 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,18 @@ class AutoResponsive extends React.Component {
5454
5555 renderChildren ( ) {
5656 return React . Children . map ( this . props . children , function ( child , childIndex ) {
57+ let childStyle = { } ;
58+
59+ if ( child . props . style instanceof Array ) {
60+ child . props . style . forEach ( ( style ) => {
61+ childStyle = Util . extend ( childStyle , style ) ;
62+ } ) ;
63+ } else {
64+ childStyle = child . props . style ;
65+ }
5766
58- let childWidth = parseInt ( child . props . style . width ) + this . props . itemMargin ;
59- let childHeight = parseInt ( child . props . style . height ) + this . props . itemMargin ;
67+ let childWidth = parseInt ( childStyle . width ) + this . props . itemMargin ;
68+ let childHeight = parseInt ( childStyle . height ) + this . props . itemMargin ;
6069 let calculatedPosition = this . sortManager . getPosition ( childWidth , childHeight , this . containerStyle . height ) ;
6170
6271 if ( ! this . fixedContainerHeight ) {
@@ -80,7 +89,7 @@ class AutoResponsive extends React.Component {
8089 }
8190
8291 return React . cloneElement ( child , {
83- style : Util . extend ( { } , child . props . style , calculatedStyle )
92+ style : Util . extend ( { } , childStyle , calculatedStyle )
8493 } ) ;
8594 } , this ) ;
8695 }
You can’t perform that action at this time.
0 commit comments