yarn react-flip-move 2.4.0
v2.4.0

latest releases: 3.0.5, 3.0.4, 3.0.3...
7 years ago

Add prop getPosition()

For calculating position, FlipMove uses getBoundingClientRect. This method provides the top/left/right/bottom positions of the element relative to the viewport, and it's how FlipMove figures out where stuff needs to be moved to.

Unfortunately, it fails in certain situations (eg. inside a scaled container).

This prop allows you to specify a custom function to be used instead of getBoundingClientRect. It accepts the DOM node as an argument and should return an object with top/left/right/bottom and width/height properties.

It is unlikely to be needed by most users, but a good escape hatch to have when those situations come up :)

Huge props to @Guuz for his work implementing this feature.

Don't miss a new react-flip-move release

NewReleases is sending notifications on new releases.