@@ -70,14 +70,15 @@ const useTableManager = (props) => {
7070 tableManager . rowVirtualizer = useRowVirtualizer ( props , tableManager ) ;
7171 tableManager . asyncApi = useAsync ( props , tableManager ) ;
7272 tableManager . isLoading = props . isLoading ?? ( tableManager . mode !== 'sync' && tableManager . asyncApi . isLoading ) ;
73+ const searchText = ( tableManager . searchApi . searchText . length >= tableManager . config . minSearchChars ) ? tableManager . searchApi . searchText : '' ;
7374
7475 // reset page number
7576 useEffect ( ( ) => {
7677 if ( ! tableManager . isInitialized ) return ;
7778 if ( tableManager . paginationApi . page === 1 ) return ;
7879
7980 tableManager . paginationApi . setPage ( 1 ) ;
80- } , [ tableManager . searchApi . searchText , tableManager . paginationApi . pageSize ] )
81+ } , [ searchText , tableManager . paginationApi . pageSize ] )
8182
8283 // reset rows
8384 useEffect ( ( ) => {
@@ -87,12 +88,12 @@ const useTableManager = (props) => {
8788 tableManager . rowSelectionApi . setSelectedRowsIds ( [ ] ) ;
8889 tableManager . asyncApi . resetRows ( ) ;
8990 }
90- } , [ tableManager . searchApi . searchText , tableManager . sortApi . sort . colId , tableManager . sortApi . sort . isAsc ] )
91+ } , [ searchText , tableManager . sortApi . sort . colId , tableManager . sortApi . sort . isAsc ] )
9192
9293 // reset edit row
9394 useEffect ( ( ) => {
9495 if ( tableManager . rowEditApi . editRow ) tableManager . rowEditApi . setEditRowId ( null ) ;
95- } , [ tableManager . searchApi . searchText , tableManager . sortApi . sort . colId , tableManager . sortApi . sort . isAsc , tableManager . paginationApi . page ] )
96+ } , [ searchText , tableManager . sortApi . sort . colId , tableManager . sortApi . sort . isAsc , tableManager . paginationApi . page ] )
9697
9798 // initialization completion
9899 useEffect ( ( ) => {
0 commit comments