Skip to content

Releases: ethanselzer/react-cursor-position

Support Element Dimensions

26 May 21:26
Compare
Choose a tag to compare

Addresses Issue #7

  • Child components and the onPositionChanged callback receive a new property named elementDimensions. elementDimensions is an object with width and height 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

14 May 20:36
Compare
Choose a tag to compare

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

10 May 00:01
Compare
Choose a tag to compare

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

04 Feb 16:59
Compare
Choose a tag to compare

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

01 Feb 19:52
Compare
Choose a tag to compare

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

26 Sep 03:58
Compare
Choose a tag to compare

Optionally provide a style object to be applied to the container element rendered by react-cursor-position.