Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
robavs opened this issue Feb 27, 2025 · 0 comments
Open

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

robavs opened this issue Feb 27, 2025 · 0 comments

Comments

@robavs
Copy link

robavs commented Feb 27, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant