Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-autocompleter

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-autocompleter - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

11

dist/AutoCompleter.js

@@ -153,2 +153,13 @@ 'use strict';

_createClass(AutoCompleter, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
// update itemList if itemList prop changed, and clear the input field
if (nextProps.data !== this.props.data) {
this.setState({
itemList: nextProps.data,
inputValue: ''
});
}
}
}, {
key: 'render',

@@ -155,0 +166,0 @@ value: function render() {

17

dist/ListContainer.js

@@ -11,2 +11,4 @@ 'use strict';

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

@@ -26,2 +28,6 @@

var _lodash = require('lodash');
var _ = _interopRequireWildcard(_lodash);
var ListContainer = (function (_Component) {

@@ -54,3 +60,3 @@ _inherits(ListContainer, _Component);

_get(Object.getPrototypeOf(ListContainer.prototype), 'constructor', this).call(this);
var styles = JSON.parse(JSON.stringify(props.itemStyles));
var styles = _.cloneDeep(props.itemStyles);

@@ -76,6 +82,7 @@ if (styles['.active']) {

var styles = _props.styles;
var itemStyles = _props.itemStyles;
var navigate = _props.navigate;
var activeStyle = this.state.activeStyle;
// lodash cloneDeep prevents data mutation
var itemStyles = _.cloneDeep(this.props.itemStyles);
if (itemStyles['.active']) {

@@ -89,7 +96,3 @@ delete itemStyles['.active'];

data.map(function (item, index) {
if (navigate === index) {
return _react2['default'].createElement(_ListItem2['default'], { onSelect: onSelect, content: item, key: item, className: itemClassName, styles: activeStyle, active: navigate === index });
}
return _react2['default'].createElement(_ListItem2['default'], { onSelect: onSelect, content: item, key: item, className: itemClassName, styles: itemStyles, active: navigate === index });
return _react2['default'].createElement(_ListItem2['default'], { onSelect: onSelect, content: item, key: item, className: itemClassName, styles: navigate === index ? activeStyle : itemStyles, active: navigate === index });
})

@@ -96,0 +99,0 @@ );

{
"name": "react-autocompleter",
"author": "Invertase",
"version": "1.0.9",
"version": "1.0.10",
"description": "A simple, configurable, styleable ReactJS component which completes your phrase with keyboard navigation support.",

@@ -43,3 +43,6 @@ "main": "./dist/AutoCompleter.js",

"playground": "webpack-dev-server --config ./playground/webpack.config.js --colors --inline --port 3000"
},
"dependencies": {
"lodash": "^4.5.1"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc