From f61d578b260cd255b11b43a9879ac76bc593ae03 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Thu, 23 Jan 2020 10:03:27 -0800 Subject: [PATCH] Show tooltip when no plugins are selected Summary: Shows tooltip when no plugins are selected. Before it used to select all the plugins Reviewed By: jknoxville Differential Revision: D19537054 fbshipit-source-id: 567b90f981a2a2ddcf68a1dce902db0a9d6214d2 --- src/chrome/ExportDataPluginSheet.tsx | 14 +------------- src/chrome/ListView.tsx | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/chrome/ExportDataPluginSheet.tsx b/src/chrome/ExportDataPluginSheet.tsx index c82f299bb..bb192a8fc 100644 --- a/src/chrome/ExportDataPluginSheet.tsx +++ b/src/chrome/ExportDataPluginSheet.tsx @@ -76,12 +76,6 @@ class ExportDataPluginSheet extends Component { }; } - componentDidMount() { - if (this.props.plugins.selectedPlugins.length <= 0) { - this.props.setSelectedPlugins(this.state.availablePluginsToExport); - } - } - render() { const {onHide} = this.props; const onHideWithUnsettingShare = () => { @@ -119,13 +113,7 @@ class ExportDataPluginSheet extends Component { } }} onChange={selectedArray => { - if (selectedArray.length > 0) { - this.props.setSelectedPlugins(selectedArray); - } else { - this.props.setSelectedPlugins( - this.state.availablePluginsToExport, - ); - } + this.props.setSelectedPlugins(selectedArray); }} elements={this.state.availablePluginsToExport} selectedElements={new Set(this.props.plugins.selectedPlugins)} diff --git a/src/chrome/ListView.tsx b/src/chrome/ListView.tsx index b3ad0a7b6..4b5a4efc0 100644 --- a/src/chrome/ListView.tsx +++ b/src/chrome/ListView.tsx @@ -17,6 +17,7 @@ import { Checkbox, colors, View, + Tooltip, } from '../ui'; import React, {Component} from 'react'; @@ -169,9 +170,22 @@ export default class ListView extends Component { - + + + )}