diff --git a/app/components/Sidebar/Sidebar.js b/app/components/Sidebar/Sidebar.js index 348d7dcaa..d337d4220 100644 --- a/app/components/Sidebar/Sidebar.js +++ b/app/components/Sidebar/Sidebar.js @@ -29,7 +29,6 @@ type Props = { @observer class Sidebar extends Component { props: Props; - scrollable: ?HTMLDivElement; handleCreateCollection = () => { this.props.ui.setActiveModal('collection-new'); @@ -39,20 +38,6 @@ class Sidebar extends Component { this.props.ui.setActiveModal('collection-edit'); }; - setScrollableRef = ref => { - this.scrollable = ref; - }; - - scrollToActiveDocument = ref => { - const scrollable = this.scrollable; - if (!ref || !scrollable) return; - - const container = scrollable.getBoundingClientRect(); - const bounds = ref.getBoundingClientRect(); - const scrollTop = bounds.top + container.top; - scrollable.scrollTop = scrollTop; - }; - render() { const { auth, ui } = this.props; const { user, team } = auth; @@ -71,7 +56,7 @@ class Sidebar extends Component { /> - +
}> Home @@ -88,7 +73,6 @@ class Sidebar extends Component { history={this.props.history} location={this.props.location} onCreateCollection={this.handleCreateCollection} - activeDocumentRef={this.scrollToActiveDocument} />
diff --git a/app/components/Sidebar/components/Collections.js b/app/components/Sidebar/components/Collections.js index b09e365b9..dcafa20ee 100644 --- a/app/components/Sidebar/components/Collections.js +++ b/app/components/Sidebar/components/Collections.js @@ -27,7 +27,6 @@ type Props = { collections: CollectionsStore, documents: DocumentsStore, onCreateCollection: () => void, - activeDocumentRef: HTMLElement => void, ui: UiStore, }; @@ -36,14 +35,7 @@ class Collections extends Component { props: Props; render() { - const { - history, - location, - collections, - ui, - activeDocumentRef, - documents, - } = this.props; + const { history, location, collections, ui, documents } = this.props; return ( @@ -55,7 +47,6 @@ class Collections extends Component { location={location} collection={collection} activeDocument={documents.active} - activeDocumentRef={activeDocumentRef} prefetchDocument={documents.prefetchDocument} ui={ui} /> @@ -79,7 +70,6 @@ type CollectionLinkProps = { collection: Collection, ui: UiStore, activeDocument: ?Document, - activeDocumentRef: HTMLElement => void, prefetchDocument: (id: string) => Promise, }; @@ -100,7 +90,6 @@ class CollectionLink extends Component { collection, activeDocument, ui, - activeDocumentRef, prefetchDocument, } = this.props; const expanded = collection.id === ui.activeCollectionId; @@ -140,7 +129,6 @@ class CollectionLink extends Component { {collection.documents.map(document => (