@pnkx-lib/ui 1.9.293 → 1.9.294
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.
- package/es/ui/index.js +14 -0
- package/package.json +1 -1
package/es/ui/index.js
CHANGED
|
@@ -5392,6 +5392,7 @@ const Table = ({
|
|
|
5392
5392
|
const status = filters?.status;
|
|
5393
5393
|
//! State
|
|
5394
5394
|
const [openSetting, setOpenStting] = useState(false);
|
|
5395
|
+
const tableContainerRef = useRef(null);
|
|
5395
5396
|
const rowSelection = {
|
|
5396
5397
|
selectedRowKeys: rowsSelected,
|
|
5397
5398
|
onChange: onSelect,
|
|
@@ -5458,6 +5459,18 @@ const Table = ({
|
|
|
5458
5459
|
minHeight: 200
|
|
5459
5460
|
// chiều cao tối thiểu
|
|
5460
5461
|
});
|
|
5462
|
+
useEffect(() => {
|
|
5463
|
+
const scrollToTop = () => {
|
|
5464
|
+
if (tableContainerRef.current) {
|
|
5465
|
+
const tableBody = tableContainerRef.current.querySelector(".ant-table-body");
|
|
5466
|
+
if (tableBody) {
|
|
5467
|
+
tableBody.scrollTop = 0;
|
|
5468
|
+
}
|
|
5469
|
+
}
|
|
5470
|
+
};
|
|
5471
|
+
const timeoutId = setTimeout(scrollToTop, 0);
|
|
5472
|
+
return () => clearTimeout(timeoutId);
|
|
5473
|
+
}, [filters.page]);
|
|
5461
5474
|
const tableContent = /* @__PURE__ */ jsxs(
|
|
5462
5475
|
"div",
|
|
5463
5476
|
{
|
|
@@ -5482,6 +5495,7 @@ const Table = ({
|
|
|
5482
5495
|
/* @__PURE__ */ jsxs(
|
|
5483
5496
|
"div",
|
|
5484
5497
|
{
|
|
5498
|
+
ref: tableContainerRef,
|
|
5485
5499
|
id: "table_content",
|
|
5486
5500
|
className: "bg-[#FFFFFF] p-2 rounded-bl-lg rounded-br-lg",
|
|
5487
5501
|
children: [
|