unmount during drag (#2168)

This commit is contained in:
Rishabh Saxena 2020-12-14 12:38:00 +05:30 committed by GitHub
parent 095e7d3a8c
commit 29d87a88f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,6 +176,10 @@ const DraggableComponent = (props: DraggableComponentProps) => {
const className = `${classNameForTesting}`;
const shouldRenderComponent = !(
selectedWidget === props.widgetId && isDragging
);
return (
<DraggableWrapper
className={className}
@ -184,7 +188,7 @@ const DraggableComponent = (props: DraggableComponentProps) => {
onClick={handleClick}
style={style}
>
{props.children}
{shouldRenderComponent && props.children}
{widgetBoundaries}
</DraggableWrapper>
);