cpr-select
Advanced tools
Comparing version 2.4.1 to 2.5.0
@@ -171,2 +171,6 @@ 'use strict'; | ||
focused: false | ||
}, function () { | ||
if (_this.props.onBlur) { | ||
_this.props.onBlur.call(null, _this.props.options[_this.state.selectedIndex].key, _this.props.options[_this.state.selectedIndex], _this.state.selectedIndex); | ||
} | ||
}); | ||
@@ -307,4 +311,4 @@ }, _this.highlightByText = function (charCode) { | ||
exports.default = CanopySelect; | ||
; | ||
if (typeof window !== "undefined" && window && !window.CanopySelect) window.CanopySelect = CanopySelect; |
{ | ||
"name": "cpr-select", | ||
"version": "2.4.1", | ||
"version": "2.5.0", | ||
"description": "A consistently styled cross-browser and keyboard friendly select component", | ||
@@ -28,4 +28,4 @@ "main": "lib/select.js", | ||
"babel-cli": "6.26.0", | ||
"babel-core": "6.26.0", | ||
"babel-loader": "7.1.2", | ||
"babel-core": "^6.26.3", | ||
"babel-loader": "^7.1.4", | ||
"babel-plugin-transform-decorators-legacy": "^1.3.4", | ||
@@ -36,11 +36,11 @@ "babel-preset-env": "^1.6.0", | ||
"canopy-styleguide": "^6.0.0", | ||
"css-loader": "0.28.7", | ||
"jasmine-core": "2.8.0", | ||
"css-loader": "^0.28.11", | ||
"jasmine-core": "^3.1.0", | ||
"jsx-loader": "0.13.2", | ||
"karma": "1.7.1", | ||
"karma": "^2.0.2", | ||
"karma-chrome-launcher": "2.2.0", | ||
"karma-jasmine": "1.1.0", | ||
"karma-jasmine": "^1.1.2", | ||
"karma-phantomjs-launcher": "1.0.4", | ||
"karma-sourcemap-loader": "0.3.7", | ||
"karma-webpack": "2.0.4", | ||
"karma-webpack": "^3.0.0", | ||
"lodash": "^4.17.4", | ||
@@ -53,3 +53,3 @@ "phantomjs-polyfill": "0.0.2", | ||
"style-loader": "0.18.2", | ||
"webpack": "3.6.0" | ||
"webpack": "^4.12.0" | ||
}, | ||
@@ -56,0 +56,0 @@ "dependencies": {}, |
@@ -21,2 +21,3 @@ cpr-select [![Build Status](https://travis-ci.org/CanopyTax/cpr-select.png?branch=master)](https://travis-ci.org/CanopyTax/cpr-select) | ||
+ `onChange`: called when selected item changes | ||
+ `onBlur`: called when the select widget is blurred (with the currently selected item) | ||
+ `disabled`: pass true to disable the input | ||
@@ -23,0 +24,0 @@ + `placeholder`: placeholder for input |
@@ -30,7 +30,7 @@ import React from 'react'; | ||
document.body.addEventListener('click', this.state.close); | ||
}; | ||
} | ||
componentWillUnmount() { | ||
document.body.removeEventListener('click', this.state.close); | ||
}; | ||
} | ||
@@ -173,3 +173,12 @@ componentDidMount() { | ||
focused: false | ||
}); | ||
}, () => { | ||
if (this.props.onBlur) { | ||
this.props.onBlur.call( | ||
null, | ||
this.props.options[this.state.selectedIndex].key, | ||
this.props.options[this.state.selectedIndex], | ||
this.state.selectedIndex | ||
); | ||
} | ||
}); | ||
}; | ||
@@ -269,4 +278,4 @@ | ||
} | ||
}; | ||
} | ||
if (typeof window !== "undefined" && window && !window.CanopySelect) window.CanopySelect = CanopySelect; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
890
57
34188
9