Releases: ethanselzer/react-cursor-position
Support Element Dimensions
Addresses Issue #7
- Child components and the
onPositionChanged
callback receive a new property namedelementDimensions
.elementDimensions
is an object withwidth
andheight
properties of type Number. Dimensions are taken from the element rendered by react-cursor-position. This could be especially useful in a fluid layout where element dimensions may not be known at design time. - Update dependencies and convert to babel-plugin-istanbul for code coverage instrumentation
- Special thanks to @AlexMeah for suggesting this feature and opening a prototype PR!
Bug Fix: isPositionOutside Value May Be Incorrect
Notes
- Bug fix - In the mouse environment, the value of
isPositionOutside
may be incorrect if a child element is positioned outside the react-cursor-position container - Add development build watch
- When watching tests, do not exit on error
Support Touch and React 15.5
Release Notes
Support touch
Support React 15.5
Update props API
Support ES modules
Support CJS modules
Improve UMD module
Upgrade dependencies
Update example site
Breaking Changes
Child component props change from:
{
cursorPosition: {
x: Number,
y: Number,
isOutside: Boolean
}
}
to:
{
isActive: Boolean,
isPositionOutside: Boolean,
position: {
x: Number,
y: Number
}
}
onCursorPositionChanged
becomes onPositionChanged
. It receives a parameter in the following shape:
{
isPositionOutside: Boolean,
position: {
x: Number,
y: Number
}
}
mapChildProps
now receives a parameter in the following shape:
{
isActive: Boolean,
isPositionOutside: Boolean,
position: {
x: Number,
y: Number
}
}
Support mapChildProps Property
Optionally model child component props. Function receives object as input and returns
an object that will decorate child components. See example code.
Support isOutside Property
cursorPosition
now contains a property named isOutside
that will be set when the mouse cursor moves outside the target element.
Dependencies have been updated.
Support Style Prop
Optionally provide a style object to be applied to the container element rendered by react-cursor-position.