Skip to content

Dragged Element Includes Border When Partially Out of View in List #193

@robavs

Description

@robavs

In my original application, I have multiple complex components displayed in a list. Each component is different and quite intricate. Additionally, every specific component consists of many nested components, and the CSS is somewhat complex.

When an element is partially out of view due to the scroll position and I initiate a drag action at that moment, a bug occurs where the dragged element also includes the border from the component below it, as shown in the attached image.

Code Example can be found here

I know that this issue can be avoided using React Portal and the setCustomNativeDragPreview method as discussed in documentation. However, I only know how to apply this solution when dealing with a single unique simple component with very little styles applied. In my case, I have a Wrapper component that receives complex a specific child component as a prop and assigns it the ability to be draggable.

Image

So, my question is: how can I ensure that any component received as a prop in the Wrapper component, regardless of its complexity, is rendered identically using React Portal? Or, if there is another way to solve this issue, I would appreciate any suggestions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions