From dbc1e4d350853f2647e9a6bd4af4580987a62541 Mon Sep 17 00:00:00 2001 From: Arpit Date: Sat, 29 Jan 2022 06:58:51 +0530 Subject: [PATCH] =?UTF-8?q?[Bugfix]=20On=20clicking=20Go=20to=20all=20data?= =?UTF-8?q?sources,=20UI=20renders=20the=20same=20compone=E2=80=A6=20(#193?= =?UTF-8?q?0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fixes: On clicking Go to all datasources, UI renders the same component again * fixes: modal datasource state update issue * removes unwanted comments --- frontend/src/Editor/DataSourceManager/DataSourceManager.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/Editor/DataSourceManager/DataSourceManager.jsx b/frontend/src/Editor/DataSourceManager/DataSourceManager.jsx index a949c13c18..5cb1ad8775 100644 --- a/frontend/src/Editor/DataSourceManager/DataSourceManager.jsx +++ b/frontend/src/Editor/DataSourceManager/DataSourceManager.jsx @@ -519,7 +519,7 @@ class DataSourceManager extends React.Component { show={this.props.showDataSourceManagerModal} size={selectedDataSource ? 'lg' : 'xl'} onEscapeKeyDown={this.hideModal} - className={selectedDataSource ? 'mt-5 animation-fade' : 'mt-5 select-datasource-list-modal animation-fade'} + className={selectedDataSource ? 'animation-fade' : 'select-datasource-list-modal animation-fade'} contentClassName={this.props.darkMode ? 'theme-dark' : ''} animation={false} onExit={this.onExit} @@ -771,6 +771,9 @@ const SearchBoxContainer = ({ onChange, onClear, queryString, activeDatasourceLi } }, [queryString]); React.useEffect(() => { + if (searchText === '') { + onClear(); + } if (searchText) { document.querySelector('.input-icon .form-control:not(:first-child)').style.paddingLeft = '0.5rem'; } @@ -778,6 +781,7 @@ const SearchBoxContainer = ({ onChange, onClear, queryString, activeDatasourceLi return () => { document.querySelector('.input-icon .form-control:not(:first-child)').style.paddingLeft = '2.5rem'; }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [searchText]); return (