Add onTouchStart to ListItem
parent
abf91d3d24
commit
6f7a5433b6
|
@ -62,11 +62,11 @@ const factory = (ripple, ListItemLayout, ListItemContent) => {
|
|||
}
|
||||
|
||||
render () {
|
||||
const {className, onMouseDown, to, onClick, ripple: hasRipple, theme, ...other} = this.props; //eslint-disable-line no-unused-vars
|
||||
const {className, onMouseDown, onTouchStart, to, onClick, ripple: hasRipple, theme, ...other} = this.props; //eslint-disable-line no-unused-vars
|
||||
const children = this.groupChildren();
|
||||
const content = <ListItemLayout theme={theme} {...children} {...other}/>;
|
||||
return (
|
||||
<li className={`${theme.listItem} ${className}`} onClick={this.handleClick} onMouseDown={onMouseDown}>
|
||||
<li className={`${theme.listItem} ${className}`} onClick={this.handleClick} onMouseDown={onMouseDown} onTouchStart={onTouchStart}>
|
||||
{to ? <a href={this.props.to}>{content}</a> : content}
|
||||
{children.ignored}
|
||||
</li>
|
||||
|
|
|
@ -102,19 +102,20 @@ var factory = function factory(ripple, ListItemLayout, ListItemContent) {
|
|||
var _props = this.props;
|
||||
var className = _props.className;
|
||||
var onMouseDown = _props.onMouseDown;
|
||||
var onTouchStart = _props.onTouchStart;
|
||||
var to = _props.to;
|
||||
var onClick = _props.onClick;
|
||||
var hasRipple = _props.ripple;
|
||||
var theme = _props.theme;
|
||||
|
||||
var other = _objectWithoutProperties(_props, ['className', 'onMouseDown', 'to', 'onClick', 'ripple', 'theme']); //eslint-disable-line no-unused-vars
|
||||
var other = _objectWithoutProperties(_props, ['className', 'onMouseDown', 'onTouchStart', 'to', 'onClick', 'ripple', 'theme']); //eslint-disable-line no-unused-vars
|
||||
|
||||
|
||||
var children = this.groupChildren();
|
||||
var content = _react2.default.createElement(ListItemLayout, _extends({ theme: theme }, children, other));
|
||||
return _react2.default.createElement(
|
||||
'li',
|
||||
{ className: theme.listItem + ' ' + className, onClick: this.handleClick, onMouseDown: onMouseDown },
|
||||
{ className: theme.listItem + ' ' + className, onClick: this.handleClick, onMouseDown: onMouseDown, onTouchStart: onTouchStart },
|
||||
to ? _react2.default.createElement(
|
||||
'a',
|
||||
{ href: this.props.to },
|
||||
|
|
Loading…
Reference in New Issue