From 11869122b4fe00c834347f9911985d7b2572bc9b Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Wed, 1 Aug 2018 17:33:28 +0200
Subject: Update React-scroll, getting rid of the need to manually set the url
 hash

---
 .../react-shared/src/components/nested_sidebar_menu.tsx | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

(limited to 'packages/react-shared/src/components/nested_sidebar_menu.tsx')

diff --git a/packages/react-shared/src/components/nested_sidebar_menu.tsx b/packages/react-shared/src/components/nested_sidebar_menu.tsx
index aa00d5985..10bcb7d8c 100644
--- a/packages/react-shared/src/components/nested_sidebar_menu.tsx
+++ b/packages/react-shared/src/components/nested_sidebar_menu.tsx
@@ -94,14 +94,11 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
                         key={`menuItem-${menuItemName}`}
                         to={id}
                         offset={-10}
+                        hashSpy={true}
                         duration={constants.DOCS_SCROLL_DURATION_MS}
                         containerId={constants.DOCS_CONTAINER_ID}
                     >
-                        <MenuItem
-                            onTouchTap={this._onMenuItemClick.bind(this, finalMenuItemName)}
-                            style={menuItemStyles}
-                            innerDivStyle={menuItemInnerDivStyles}
-                        >
+                        <MenuItem style={menuItemStyles} innerDivStyle={menuItemInnerDivStyles}>
                             <span style={{ textTransform: 'capitalize' }}>{finalMenuItemName}</span>
                         </MenuItem>
                     </ScrollLink>
@@ -128,12 +125,11 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
                             <ScrollLink
                                 to={id}
                                 offset={0}
+                                hashSpy={true}
                                 duration={constants.DOCS_SCROLL_DURATION_MS}
                                 containerId={constants.DOCS_CONTAINER_ID}
-                                onTouchTap={this._onMenuItemClick.bind(this, name)}
                             >
                                 <MenuItem
-                                    onTouchTap={this._onMenuItemClick.bind(this, name)}
                                     style={{ minHeight: 35 }}
                                     innerDivStyle={{
                                         paddingLeft: 16,
@@ -150,11 +146,4 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
             </ul>
         );
     }
-    private _onMenuItemClick(name: string): void {
-        const id = utils.getIdFromName(name);
-        utils.setUrlHash(id);
-        if (!_.isUndefined(this.props.onMenuItemClick)) {
-            this.props.onMenuItemClick();
-        }
-    }
 }
-- 
cgit v1.2.3

