Skip to content

Commit 249a9ad

Browse files
committed
Changed search method in Data Sources.
1 parent a8ae813 commit 249a9ad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

client/packages/lowcoder/src/pages/datasource/datasourceList.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,18 @@ export const DatasourceList = () => {
119119
elements: DatasourceInfo[];
120120
total: number;
121121
}
122-
console.log(datasource);
123122

124123
const [elements, setElements] = useState<ElementsState>({ elements: [], total: 0 });
125124
const [currentPage, setCurrentPage] = useState(1);
126125
const [pageSize, setPageSize] = useState(10);
127126

127+
useEffect(()=> {
128+
setTimeout(() => {
129+
if (searchValue.length > 2 || searchValue === "")
130+
setSearchValues(searchValue)
131+
}, 500);
132+
})
133+
128134
useEffect( () => {
129135
fetchDatasourcePagination(
130136
{
@@ -174,7 +180,6 @@ export const DatasourceList = () => {
174180
placeholder={trans("search")}
175181
value={searchValue}
176182
onChange={(e) => setSearchValue(e.target.value)}
177-
onEnterPress={(value) => setSearchValues(value)}
178183
style={{ width: "192px", height: "32px", margin: "0 12px 0 0" }} />
179184
<AddBtn buttonType={"primary"} onClick={() => showCreateForm(true)}>
180185
{trans("home.newDatasource")}

0 commit comments

Comments
 (0)