Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fixed Panel blank page issue

Blue Mouse0a68b90e8499
diff --git a/src/pages/Project/View/Panels.jsx b/src/pages/Project/View/Panels.jsx
index ac2541a66..5714e11c2 100644
--- a/src/pages/Project/View/Panels.jsx
+++ b/src/pages/Project/View/Panels.jsx
@@ -1,4 +1,4 @@
-import React, { memo, useState, useMemo, Fragment } from 'react'
+import React, { memo, useState, useEffect, useMemo, Fragment } from 'react'
import { ArrowSmUpIcon, ArrowSmDownIcon } from '@heroicons/react/solid'
import { FilterIcon } from '@heroicons/react/outline'
import cx from 'clsx'
@@ -238,16 +238,20 @@ const Panel = ({
const _onFilter = hideFilters ? () => { } : onFilter
+ useEffect(() => {
+ const sizeKeys = _size(keys)
+
+ if (currentIndex > sizeKeys) {
+ setPage(_floor(sizeKeys / ENTRIES_PER_PANEL))
+ }
+ }, [currentIndex, keys])
+
const onPrevious = () => {
if (canGoPrev()) {
setPage(page - 1)
}
}
- const onRowLinkClick = (e) => {
- e.stopPropagation()
- }
-
const onNext = () => {
if (canGoNext()) {
setPage(page + 1)
@@ -282,14 +286,14 @@ const Panel = ({
>
{rowData}
{!hideFilters && (
- <FilterIcon className='ml-2 w-4 h-4 text-gray-500 hidden group-hover:flex dark:text-gray-300' />
+ <FilterIcon className='ml-2 w-4 h-4 text-gray-500 hidden group-hover:block dark:text-gray-300' />
)}
</a>
) : (
<span className={cx('flex items-center label', { capitalize })}>
{rowData}
{!hideFilters && (
- <FilterIcon className='ml-2 w-4 h-4 text-gray-500 hidden group-hover:flex dark:text-gray-300' />
+ <FilterIcon className='ml-2 w-4 h-4 text-gray-500 hidden group-hover:block dark:text-gray-300' />
)}
</span>
)}