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
Wrong dragPreview in Chrome #832
Comments
@tTwisTt I'm facing this exactly issue, did you figure out the fix? |
@kaiomagalhaes In my case I was getting this issue due one of child element of row (cell content) in fact had height that was greater than row height, but was hidden by visibility: hidden in css. So dragSource had width of rows and height of hidden control. I hope you'll find this helpful. |
@tTwisTt I can confirm that, same happens with overflow: hidden. is there a way to drag elements like these without the wrong preview? |
This issue is closed, but it seems to still be a issue, shouldn't it be reopened? |
I also have this same issue - when I start dragging the preview is too large and does not respect parts which should be hidden by overflow. EDIT: I was able to fix it by not using a relative positioned image in the element but instead a div with a background image instead. |
I experienced a similar issue when I try and drag a div wrapped material ui Expansion Panel that is collapsed, it ends up giving me a preview that is the height of the panel expanded but includes elements from the page around the panel, since the visible portion of the panel is smaller than the preview. |
i resolved this issue on chrome by adding transform: translate3d(0, 0, 0) to my containing element. |
@RahulRameshNarayan this also worked for me. THANK YOU! |
@jsyvino its a repaint issue on chrome. translate3d forces better hardware acceleration on that element. This is also a hack that people use to solve flickering of scrolling elements in screens of higher resolutions. you can read further about this topics in the following articles. Let's Play With Hardware-Accelerated CSS- Accelerated Rendering in Chrome Simplify Paint Complexity and Reduce Paint Areas |
I'm also getting this issue on Chrome 75 when using a Material-UI ListItem as the draggable node. I think the Ripple element that is contained by overflow: hidden is what's causing the sizing mismatch. As @makr11 mentions, @RahulRameshNarayan's fix does somehow solve this (by hiding the surrounding elements from the drag preview, seemingly), it does still have the position offset that it would as if those elements were visible, so it's still 'broken' in my opinion. Does anyone understand what the underlying issue is here, seemingly at the DOM or Native/HTML5 drag preview generation level maybe? Would love to tackle fixing this properly. |
Same here, i'm getting this issue on Chrome 75, on Firefox works fine... This should be reopened! |
My use case is specific but maybe it will help someone, I use velocity-dashboard which uses react-dnd, and inside widgets (which is a draggable component) is rendered react-chart-js. The problem happened when chart-js was rendered inside widget. I just set that when widget is draggable, basic div is rendered inside widget and not chart-js component. Again, it's pretty specific and i'm not an expert for the subject but maybe this will help someone. |
Issue still reproduced (Chrome 75.0.3770.100 )but resolves by adding transform: translate3d(0) to contain element. Thanks @RahulRameshNarayan |
I'm also experiencing the same trouble. I tried to solve it by adding |
Issue is still presence in the:
|
@mismith I am struggling with exactly this problem (also using MUI ListItem), did you come up with a solution? |
@dotbear Sadly no, I am just living with it :( |
I agree this issue should not be closed without an official workaround that avoids the giant offset problem. |
Any news refering to this problem? |
This issue is still an open problem. It should really be re opened! |
Any updates here ? This issue still exists |
Same here. |
I resolved this bug by disabling Ripple effect of material UI. |
|
from: #1608 (comment)
That worked for me. I had an child element bigger than the drag ref parent so the size when dragging was the size of the biggest (the child). TL;DR: Child elements must not be bigger than the drag ref |
This issue seems like it's still present. Adding transform: translate3d(0, 0, 0) to the parent container fixed in Chrome... but is that it? Seems like this isn't completely resolved. |
Setting |
Want to second that this is an issue on Chrome 119.0.6045.199 and using Specifically, we have a Three.js canvas that sometimes draws HTML elements "offscreen" which are clipped with |
But issue with dragPreview described above disappears and drag-drop works fine (one time). Then somewhere after drop event 'Cannot call beginDrag while dragging' error occurs and drag stops to work at all.
Bug appears only in Chrome (57 and 59). Any ideas?
The text was updated successfully, but these errors were encountered: