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

Respond to `bounds` change

Open wootencl opened this issue 6 years ago • 0 comments

Inspired by PR #348, I added some additional logic so if the specified bound is an HTML element a ResizeObserver will watch for changes and update the bounds + coords appropriately.

I'll admit I have zero Flow experience so somewhat off the cuff in that regard. Seems to be a linting issue related to that that I am a bit uncertain on how to resolve.

This does add a dependency (albeit fairly small at 2.5K), but ideally that can be removed once the ResizeObserver API is supported in all browsers (is already in Chrome and close in FF).

ResizeObserver CanIUse

/cc @STRML @mzabriskie

Initial work credit to @travisoneill

NOTE: Can add tests if feature/functionality is approved.

wootencl avatar Jul 31 '18 20:07 wootencl