From 7c1e63577d332a028906704ef69a7cd25a2cd5a1 Mon Sep 17 00:00:00 2001 From: Isaac Johnston Date: Mon, 14 Sep 2015 18:02:04 +1200 Subject: [PATCH] Fix #1597 Add option to Toggle Nested List Items on Primary Action --- docs/src/app/components/pages/components/lists.jsx | 1 + src/lists/list-item.jsx | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/src/app/components/pages/components/lists.jsx b/docs/src/app/components/pages/components/lists.jsx index 1d246da93a604d..88090162bc5825 100644 --- a/docs/src/app/components/pages/components/lists.jsx +++ b/docs/src/app/components/pages/components/lists.jsx @@ -362,6 +362,7 @@ class ListsPage extends React.Component { primaryText="Inbox" leftIcon={} initiallyOpen={true} + primaryTogglesNestedList={true} nestedItems={[ } />, ) : undefined; + let extraAttributes = {}; + if (primaryTogglesNestedList) { + extraAttributes.onTouchTap = this._handleNestedListToggle; + } + return hasCheckbox ? this._createLabelElement(styles, contentChildren) : disabled ? this._createDisabledElement(styles, contentChildren) : (
@@ -334,7 +341,8 @@ const ListItem = React.createClass({ onMouseEnter={this._handleMouseEnter} onTouchStart={this._handleTouchStart} ref="enhancedButton" - style={this.mergeAndPrefix(styles.root, style)}> + style={this.mergeAndPrefix(styles.root, style)} + {...extraAttributes}>
{contentChildren}