Skip to content

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

fixing issue with clearing selection on dir change

Ilian Sapundshiev316302e406a3
diff --git a/app/perspectives/grid-perspective/src/index.js b/app/perspectives/grid-perspective/src/index.js
index 466b12a9d..89841eaec 100644
--- a/app/perspectives/grid-perspective/src/index.js
+++ b/app/perspectives/grid-perspective/src/index.js
@@ -367,6 +367,9 @@ class GridPerspective extends React.Component<Props, State> {
nextProps.currentDirectoryPath !== this.props.currentDirectoryPath &&
this.mainGrid
) {
+ // Clear selection on directory change
+ this.clearSelection();
+
const grid = document.querySelector(
'[data-tid="perspectiveGridFileTable"]'
);
@@ -375,9 +378,6 @@ class GridPerspective extends React.Component<Props, State> {
if (isObj(firstGridItem)) {
firstGridItem.scrollIntoView({ top: 0 });
}
-
- // Clear selection on directory change
- this.clearSelection();
}
};