react-autowhatever
Advanced tools
Comparing version 1.1.2 to 1.2.1
@@ -130,2 +130,3 @@ 'use strict'; | ||
var onMouseDown = _props$itemProps.onMouseDown; | ||
var onClick = _props$itemProps.onClick; | ||
@@ -142,10 +143,14 @@ return items.map(function (item, itemIndex) { | ||
} : function () {}; | ||
var onClickFn = onClick ? function (event) { | ||
return onClick(event, { sectionIndex: sectionIndex, itemIndex: itemIndex }); | ||
} : function () {}; | ||
var itemProps = _extends({ | ||
id: _this.getItemId(sectionIndex, itemIndex), | ||
role: 'option' | ||
}, _this.props.itemProps, { | ||
}, theme(itemIndex, 'item', sectionIndex === focusedSectionIndex && itemIndex === focusedItemIndex && 'item--focused'), _this.props.itemProps, { | ||
onMouseEnter: onMouseEnterFn, | ||
onMouseLeave: onMouseLeaveFn, | ||
onMouseDown: onMouseDownFn | ||
}, theme(itemIndex, 'item', sectionIndex === focusedSectionIndex && itemIndex === focusedItemIndex && 'item--focused')); | ||
onMouseDown: onMouseDownFn, | ||
onClick: onClickFn | ||
}); | ||
@@ -152,0 +157,0 @@ return _react2['default'].createElement( |
{ | ||
"name": "react-autowhatever", | ||
"version": "1.1.2", | ||
"version": "1.2.1", | ||
"description": "Accessible rendering layer for Autosuggest and Autocomplete components", | ||
@@ -5,0 +5,0 @@ "main": "dist/Autowhatever.js", |
@@ -76,3 +76,3 @@ import React, { Component, PropTypes } from 'react'; | ||
const { renderItem, focusedSectionIndex, focusedItemIndex } = this.props; | ||
const { onMouseEnter, onMouseLeave, onMouseDown } = this.props.itemProps; | ||
const { onMouseEnter, onMouseLeave, onMouseDown, onClick } = this.props.itemProps; | ||
@@ -89,5 +89,11 @@ return items.map((item, itemIndex) => { | ||
() => {}; | ||
const onClickFn = onClick ? | ||
event => onClick(event, { sectionIndex, itemIndex }) : | ||
() => {}; | ||
const itemProps = { | ||
id: this.getItemId(sectionIndex, itemIndex), | ||
role: 'option', | ||
...theme(itemIndex, 'item', sectionIndex === focusedSectionIndex && | ||
itemIndex === focusedItemIndex && | ||
'item--focused'), | ||
...this.props.itemProps, | ||
@@ -97,5 +103,3 @@ onMouseEnter: onMouseEnterFn, | ||
onMouseDown: onMouseDownFn, | ||
...theme(itemIndex, 'item', sectionIndex === focusedSectionIndex && | ||
itemIndex === focusedItemIndex && | ||
'item--focused') | ||
onClick: onClickFn | ||
}; | ||
@@ -102,0 +106,0 @@ |
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
51987
1288