@@ -124,71 +124,40 @@ export const SpaceInternal: React.FC<AllProps> = React.memo((props) => {
124124 onDoubleClick : props . onDoubleClick ,
125125 } ;
126126
127- return props . resizable && props . scrollable
128- ? React . createElement (
129- props . as || "div" ,
130- {
131- ...{
132- id : space . id ,
133- ref : spaceElement ,
134- className : outerClasses . join ( " " ) ,
135- } ,
136- ...passThroughEvents ,
137- } ,
138- < >
139- < HeadStyles spaces = { currentContext . children } />
140- < ResizeHandle
141- resizable = { props . resizable }
142- anchor = { props . anchor }
143- parentContext = { parentContext }
144- space = { space }
145- spaceElement = { spaceElement . current }
146- minimumSize = { props . minimumSize }
147- maximumSize = { props . maximumSize }
148- onResizeStart = { props . onResizeStart }
149- onResizeEnd = { props . onResizeEnd }
150- />
151- < div className = { innerClasses . join ( " " ) } style = { innerStyle } >
152- < SpaceContext . Provider value = { currentContext } >
153- < SpaceInfoContext . Provider value = { { width : Math . floor ( currentSize . width ) , height : Math . floor ( currentSize . height ) } } >
154- { children }
155- </ SpaceInfoContext . Provider >
156- </ SpaceContext . Provider >
157- </ div >
158- </ > ,
159- )
160- : React . createElement (
161- props . as || "div" ,
162- {
163- ...{
164- id : space . id ,
165- ref : spaceElement ,
166- className : outerClasses . join ( " " ) ,
167- style : innerStyle ,
168- } ,
169- ...passThroughEvents ,
170- } ,
171- < >
172- < HeadStyles spaces = { currentContext . children } />
173- < ResizeHandle
174- resizable = { props . resizable }
175- anchor = { props . anchor }
176- parentContext = { parentContext }
177- space = { space }
178- handleSize = { handleSize }
179- spaceElement = { spaceElement . current }
180- minimumSize = { props . minimumSize }
181- maximumSize = { props . maximumSize }
182- onResizeStart = { props . onResizeStart }
183- onResizeEnd = { props . onResizeEnd }
184- />
185- < SpaceContext . Provider value = { currentContext } >
186- < SpaceInfoContext . Provider value = { { width : Math . floor ( currentSize . width ) , height : Math . floor ( currentSize . height ) } } >
187- { children }
188- </ SpaceInfoContext . Provider >
189- </ SpaceContext . Provider >
190- </ > ,
191- ) ;
127+ const width = Math . floor ( currentSize . width ) ;
128+ const height = Math . floor ( currentSize . height ) ;
129+
130+ return React . createElement (
131+ props . as || "div" ,
132+ {
133+ ...{
134+ id : space . id ,
135+ ref : spaceElement ,
136+ className : outerClasses . join ( " " ) ,
137+ } ,
138+ ...passThroughEvents ,
139+ } ,
140+ < >
141+ < HeadStyles spaces = { currentContext . children } />
142+ < ResizeHandle
143+ resizable = { props . resizable }
144+ anchor = { props . anchor }
145+ parentContext = { parentContext }
146+ space = { space }
147+ spaceElement = { spaceElement . current }
148+ handleSize = { handleSize }
149+ minimumSize = { props . minimumSize }
150+ maximumSize = { props . maximumSize }
151+ onResizeStart = { props . onResizeStart }
152+ onResizeEnd = { props . onResizeEnd }
153+ />
154+ < div className = { innerClasses . join ( " " ) } style = { innerStyle } >
155+ < SpaceContext . Provider value = { currentContext } >
156+ < SpaceInfoContext . Provider value = { { width : width , height : height } } > { children } </ SpaceInfoContext . Provider >
157+ </ SpaceContext . Provider >
158+ </ div >
159+ </ > ,
160+ ) ;
192161} ) ;
193162
194163SpaceInternal . propTypes = allProps ;
0 commit comments