javascriptreactjsreact-grid-layout

React-Grid-layout shake a bit onClick


I'm working with React-grid-layout in React.js. When I click on the draggable tile, it shakes a bit, and same happens when I click on any child button on the tile. How can I stop this shaky behaviour?

enter image description here

Here, Set Alarm is a button, when I click on it, the respective tile shakes (moves a bit down and back on its position).

Thanks!


Solution

  • I had added margin on each tile that was somehow making the tiles shake. After removing the margin from css class, the issue resolved.

    Note, React-grid-layout gives a special margin attribute to add margin between tiles.

    Hope this answer help someone in future! Good day.