react-input-position
Advanced tools
Comparing version 1.3.0 to 1.3.1
# Changelog | ||
## 1.3.1 (February 6th, 2020) | ||
- Added onActivate and onDeactivate props. Allows passing callbacks to be executed when component becomes active or inactive, respectively. | ||
## 1.3.0 (January 28th, 2020) | ||
@@ -4,0 +8,0 @@ |
@@ -210,5 +210,15 @@ "use strict"; | ||
var onUpdate = this.props.onUpdate; | ||
var activationCallback; | ||
if (changes.hasOwnProperty("active")) { | ||
if (changes.active) { | ||
activationCallback = this.props.onActivate; | ||
} else { | ||
activationCallback = this.props.onDeactivate; | ||
} | ||
} | ||
if (this.props.overrideState) { | ||
onUpdate && onUpdate(changes); | ||
activationCallback && activationCallback(); | ||
cb && cb.call(this); | ||
@@ -222,2 +232,3 @@ return; | ||
cb && cb.call(_this3); | ||
activationCallback && activationCallback(); | ||
onUpdate && onUpdate(_this3.getStateClone()); | ||
@@ -605,3 +616,5 @@ }); | ||
overrideState: _propTypes["default"].object, | ||
mouseDownAllowOutside: _propTypes["default"].bool | ||
mouseDownAllowOutside: _propTypes["default"].bool, | ||
onActivate: _propTypes["default"].func, | ||
onDeactivate: _propTypes["default"].func | ||
}); | ||
@@ -608,0 +621,0 @@ |
{ | ||
"name": "react-input-position", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "A React component that decorates it's children with mouse/touch position tracking, a status toggle fired by click/gesture events, and more.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -168,2 +168,6 @@ # react-input-position | ||
**onActivate:** Callback function to be executed when component becomes active. Type: function. | ||
**onDeactivate:** Callback function to be executed when component becomes inactive. Type: function. | ||
## Inversion of Control Props | ||
@@ -170,0 +174,0 @@ |
56807
1096
236