Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix scrolling

sytolkcb31b420ae1d
diff --git a/src/renderer/perspectives/grid-perspective/components/GridPagination.tsx b/src/renderer/perspectives/grid-perspective/components/GridPagination.tsx
index 7e7d2b28b..e2643baa8 100644
--- a/src/renderer/perspectives/grid-perspective/components/GridPagination.tsx
+++ b/src/renderer/perspectives/grid-perspective/components/GridPagination.tsx
@@ -126,7 +126,7 @@ function GridPagination(props: Props) {
? Math.ceil(allFilesCount / gridPageLimit)
: 10;
- const containerEl = useRef(null);
+ const containerEl = useRef<HTMLDivElement>(null);
const folderTmbPath = useRef<string>(
getFolderThumbPath(currentDirectoryPath, lastThumbnailImageChange),
);
@@ -134,7 +134,7 @@ function GridPagination(props: Props) {
getFolderBgndPath(currentDirectoryPath, lastBackgroundImageChange),
);
- const [, forceUpdate] = useReducer((x) => x + 1, 0);
+ const [, forceUpdate] = useReducer((x) => x + 1, 0, undefined);
// TODO move in DirectoryContentContextProvider
useEffect(() => {
@@ -153,11 +153,11 @@ function GridPagination(props: Props) {
forceUpdate();
}, [props.currentDirectoryPath, props.lastBackgroundImageChange]);
- useEffect(() => {
+ /*useEffect(() => {
if (containerEl && containerEl.current) {
containerEl.current.scrollTop = 0;
}
- }, [currentDirectoryEntries]);
+ }, [currentDirectoryEntries]);*/
const handleChange = (event, value) => {
setCurrentPage(value);
diff --git a/src/renderer/perspectives/grid-perspective/components/MainContainer.tsx b/src/renderer/perspectives/grid-perspective/components/MainContainer.tsx
index 91f81b8c1..75555041e 100644
--- a/src/renderer/perspectives/grid-perspective/components/MainContainer.tsx
+++ b/src/renderer/perspectives/grid-perspective/components/MainContainer.tsx
@@ -111,7 +111,7 @@ function GridPerspective(props: Props) {
const [isGridSettingsDialogOpened, setIsGridSettingsDialogOpened] =
useState<boolean>(false);
- useEffect(() => {
+ /*useEffect(() => {
if (selectedEntries.length === 1) {
makeFirstSelectedEntryVisible();
}
@@ -133,7 +133,7 @@ function GridPerspective(props: Props) {
console.debug('makeFirstSelectedEntryVisible:', ex);
}
}
- };
+ };*/
const handleSortBy = (handleSort) => {
if (sortBy !== handleSort) {