mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
[Bugfix] On clicking Go to all datasources, UI renders the same compone… (#1930)
* fixes: On clicking Go to all datasources, UI renders the same component again * fixes: modal datasource state update issue * removes unwanted comments
This commit is contained in:
parent
387433f0a4
commit
dbc1e4d350
1 changed files with 5 additions and 1 deletions
|
|
@ -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 (
|
||||
|
|
|
|||
Loading…
Reference in a new issue