0

I'm using react-dragula to drag and drop cards. I need to save it after dragging it. How should I save the cards position after drag and drop?

This is the function.

const dragDropRow1 = (componentBackingInstance) => {
    if (componentBackingInstance) {
      let options = { };
      Dragula([componentBackingInstance], options);
        console.log("find1", options)
        console.log("find2", componentBackingInstance)
        console.log("find3", dragDropRow1)
    }
};

This is how I use the function in the body.

<Grid container ref={dragDropRow1} spacing={2} className="dragdrop-container">

This is the cards I'm using in the body.

< Typography variant = "subtitle1"
component = "h2"
className = "widget-title" > {
    getLabel({
      module: "frontOfficerDashboard",
      label: "opd appointments"
    })
  } <
  /Typography> <
  Box className = "widget-table" >
  <
  Box display = "flex" >
  <
  Box flexGrow = {
    1
  } >
  <
  Typography variant = "body2"
component = "p"
className = "color-primary" > {
    getLabel({
      module: "frontOfficerDashboard",
      label: "today total"
    })
  } <
  /Typography> <
  /Box>
Dharman
  • 30,962
  • 25
  • 85
  • 135
  • This is a link to codepen which contains the complete code. - https://codepen.io/vinulak/pen/OJbRgvr –  Feb 10 '21 at 06:51
  • Sorry but I find your code rather unreadable. And I wouldn't turn the prose into quotes either. – Martin Feb 10 '21 at 08:31
  • Is this code in https://codepen.io/vinulak/pen/OJbRgvr unreadable too? –  Feb 10 '21 at 08:57

0 Answers0