how to hightlight empty gird area when i dragging items #2006
Asif-Saheer-k
started this conversation in
General
Replies: 1 comment
-
you can, you just need to get the placeholders position inside of grid layout. unfortunately, the ondrag and onresize item callbacks are jank, and so you kind of have to settle for a jank solution. use an effect hook, set an interval to repeat every 100ms or so, and then use query selector to select the element with the ".react-grid-item.react-grid-placeholder" class. that'll let you get the elements top and left position which, combined with height and width, will allow other components to in your app to know where the placeholder is, incase you are using a custom background. that should get you where you need. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In want to highlight the empty grid areas when dragging an item, I can dynamically add a placeholder element that represents the empty space
like this image
Beta Was this translation helpful? Give feedback.
All reactions