react-resizable icon indicating copy to clipboard operation
react-resizable copied to clipboard

onResizeStop callback has wrong size when grid is applied

Open joaogardenberg opened this issue 5 years ago • 3 comments

Thanks for opening an issue!

  • [x] Bug
  • [ ] Feature Request
  • [ ] Question

Problem Report

The onResizeStop callback has wrong size when grid is applied. Its size property has width/height related to where I released my mouse click at, as if there was no grid applied.

System Info

Node Version: 13.12.0 Browser: Google Chrome 80.0.3987.163 (x64) on Windows 10 OS: Ubuntu 18.04 dockerized on Windows 10

Reproduction

https://codesandbox.io/s/react-resizable-playground-40isg Just resize the box to see.

joaogardenberg avatar Apr 04 '20 16:04 joaogardenberg

Facing this issue as well. Are there any known workarounds?

timoleinio avatar Apr 27 '20 09:04 timoleinio

@timoleinio I'm using onResize instead, until this is fixed. You could add some kind of debouncing function that executess only once every X miliseconds

joaogardenberg avatar Apr 28 '20 13:04 joaogardenberg

I also facing this issue too. I found another way comparing to @joaogardenberg , use 'ref' to div so get 'offsetWidth' when resizeStop called.

BearHunter49 avatar Mar 08 '21 03:03 BearHunter49