react-draggable
react-draggable copied to clipboard
Respond to `bounds` change
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).
/cc @STRML @mzabriskie
Initial work credit to @travisoneill
NOTE: Can add tests if feature/functionality is approved.