@megha-ui/react 1.2.279 → 1.2.280

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,6 @@ export const usePagination = (sortedData, defaultRowsPerPage) => {
7
7
  }, [defaultRowsPerPage]);
8
8
  const paginatedData = useMemo(() => {
9
9
  const startIndex = (currentPage - 1) * rowsPerPage;
10
- setCurrentPage(1);
11
10
  return sortedData.slice(startIndex, startIndex + rowsPerPage);
12
11
  }, [sortedData, currentPage, rowsPerPage]);
13
12
  const handleChangePage = (page) => {
@@ -848,6 +848,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
848
848
  };
849
849
  }, [sortedData, paginate, paginatedData]);
850
850
  useEffect(() => {
851
+ handleChangePage(1);
851
852
  setTotalPages(getTotalPages(sortedData.length, rowsPerPage));
852
853
  }, [data, sortQueries, rowsPerPage, sortedData.length]);
853
854
  const isScrollAlmostAtEnd = (element, threshold = 100) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.279",
3
+ "version": "1.2.280",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",