@@ -178,7 +178,11 @@ const Draggable: React.FC<TDraggableProps> = ({
178
178
setIsDragging ( false ) ;
179
179
isResizing . current = false ;
180
180
if ( draggableContentBody ?. style ) {
181
- Object . assign ( draggableContentBody . style , previousStyle ) ;
181
+ try {
182
+ Object . assign ( draggableContentBody . style , previousStyle ) ;
183
+ } catch {
184
+ // no need to handle this error
185
+ }
182
186
draggableContentBody . style . pointerEvents = previousPointerEvent ?? 'unset' ;
183
187
}
184
188
if ( boundaryRef ) {
@@ -196,7 +200,12 @@ const Draggable: React.FC<TDraggableProps> = ({
196
200
return (
197
201
< div
198
202
className = { `draggable ${ isDragging ? 'dragging' : '' } ` }
199
- style = { { position : 'absolute' , top : position . y , left : position . x , zIndex } }
203
+ style = { {
204
+ position : 'absolute' ,
205
+ top : typeof position . y === 'number' ? position . y : 0 ,
206
+ left : typeof position . x === 'number' ? position . x : 0 ,
207
+ zIndex : typeof zIndex === 'number' ? zIndex : 0 ,
208
+ } }
200
209
onMouseDown = { ( ) => calculateZindex ( { setZIndex } ) }
201
210
onKeyDown = { ( ) => calculateZindex ( { setZIndex } ) }
202
211
data-testid = 'dt_react_draggable'
@@ -206,7 +215,10 @@ const Draggable: React.FC<TDraggableProps> = ({
206
215
ref = { draggableRef }
207
216
className = 'draggable-content'
208
217
data-testid = 'dt_react_draggable_content'
209
- style = { { width : size . width , height : size . height } }
218
+ style = { {
219
+ width : typeof size . width === 'number' ? size . width : 0 ,
220
+ height : typeof size . height === 'number' ? size . height : 0 ,
221
+ } }
210
222
>
211
223
< div
212
224
id = 'draggable-content__header'
0 commit comments