How to change the drag animation while dragging a row in antd? - reactjs

I am using Ant Design's draggable table in a project. I am using the source code that is available for the example on their website. It works fine with drag and drop functionality but I want to change the animation when I am dragging a row. Right now it shows the snapshot of the row selected while dragging it around.
I went through the React-DnD documentation, since it is what is being used by antd. In it, there is a mention of DragPreviewImage. Now I assume it would be what is required but since I am very new to it, I am having a hard time in discovering how to fit what they say into the simple example given on the antd's website.
Following is the link to the sandbox: https://codesandbox.io/embed/dazzling-sammet-e41lf
I would like anyone's help to show me how we can change the drag animation in this source code. I will be very thankful.

Related

Draggable card that snaps to grid in React

React newbie here.
I am looking for a way to add drag and drop functionality to my website. The goal is to move cards in a grid (I am currently using tailwind css to handle the grid). I found a few libraries that enable drag and drop but none that would:
work in a grid, i.e. in 2D
snap the cards to the grid
reorganize the cards when one is moved (to prevent overlapping)
I tried using react-beautiful-dnd but it seems to only be suitable for lists (i.e. 1D). I also tried react-dnd but I couldn't make it work either, I don't think it is meant to be used in a grid.
I found some libraries that do exactly what I want in angular (https://stackblitz.com/edit/angular-dragdrop-grid) and in vue (https://codesandbox.io/s/j4vn761455), but I can't seem to find react equivalents.
Would you know a react library I could use?
Thanks

Touch users can't drag and drop in React app

I followed the quick start for the dnd kit React library, and it lets me drag and drop just fine with a mouse. However, when I try to use the same page with Chrome on Android, I can't drag the item. It looks like it starts moving and then gets stuck as soon as my finger moves outside its original border.
I tried switching to the drag overlay, but that didn't seem to make any difference.
How can I support touch users with dnd kit?
It wasn't covered in the quick start, but I found the answer in the Draggable section's recommendations:
In general, we recommend you set the touch-action property to none for draggable elements in order to prevent scrolling on mobile devices.
I found that I could either set the CSS style on the draggable element itself, or on a parent element that contains several draggable elements.
However, when I started trying to drag items around within a list or grid of items, that stopped working. Eventually, I had to switch from using the pointer sensor to using the mouse and touch sensors, as described in the sensors section.

How to make your material-ui grid into drag and drop elements

To give you the context, I built a dashboard with a material-ui grid with 3 different sizes of widgets (small, medium and large).
The widgets are not drag and drop and to move the widgets you have to go to another page of the application which is not very UX design. I've never dragged and dropped with react and I'm wondering if there is an easy way to make my material-ui drag and drop grid. I would like to have some suggestions, examples if you have thank you in advance for your help.
For information I saw that there were several libraries (react-beautiful-dnd, dnd-kit)
Here is what I have tried with dnd-kit but I cannot make my grid easily drag and drop :
https://codesandbox.io/s/dndkit-material-ui-grid-sample-ck6l3?file=/src/App.js

How to drag and drop items between 2 columns using react-beautiful-dnd and material ui

Still new coding.
I want to drag and drop things between 2 columns(From Morning to Night, vice-versa) using React JS, Material UI, and react-beautiful-dnd.
I manage to drag and drop things but on their own column only, I can't seem to make it work. How can I achieve this?
Here is the code: https://codesandbox.io/s/react-3s67c
Thanks!
You need to follow the documentation, Material-UI is not a problem to do that.
You need to follow the lesson from the library: https://egghead.io/lessons/react-conditionally-allow-movement-using-react-beautiful-dnd-draggable-and-droppable-props
I'll not do your jobs, but juste follow the doc and the exemples.
https://react-beautiful-dnd.netlify.app/?path=/story/board--simple

How to identify ExtJS elements for Coded UI window resize test

I am starting to use Coded UI in Visual Studio to test an ExtJS app's interface, and tests fail when I have a resize or drag/drop action on an ExtJS modal window with the following error:
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotVisibleException: The control is not visible.
My suspicion is that the target control for the stop location is an id that is generated by ext, which changes. Also, I don't know what panel is going to be behind the modal I'm resizing, so I can't just put an id on it. Is there a way to set the stop location relative to the viewport?
I haven't been able to find much documentation on using Coded UI with ExtJS; if anyone has experience with this I would appreciate a point in the right direction. Thanks!

Resources