From 9796f50362b231a8414850a69f418bbac0c6cf0d Mon Sep 17 00:00:00 2001 From: Khushboo Vashi Date: Thu, 7 Oct 2021 17:23:21 +0530 Subject: [PATCH] Fixed an issue where the tree is not scrolling to the object selected from the search result. Fixes #6828 --- docs/en_US/release_notes_6_1.rst | 1 + web/pgadmin/static/js/tree/tree_init.tsx | 3 ++- .../search_objects/static/js/search_objects_dialog_wrapper.js | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/en_US/release_notes_6_1.rst b/docs/en_US/release_notes_6_1.rst index 68cd762d8..4decb093e 100644 --- a/docs/en_US/release_notes_6_1.rst +++ b/docs/en_US/release_notes_6_1.rst @@ -18,3 +18,4 @@ Bug fixes ********* | `Issue #6797 `_ - Remove an extra blank line at the start of the SQL for function, procedure, and trigger function. +| `Issue #6828 `_ - Fixed an issue where the tree is not scrolling to the object selected from the search result. diff --git a/web/pgadmin/static/js/tree/tree_init.tsx b/web/pgadmin/static/js/tree/tree_init.tsx index 0587f1dc8..823428149 100644 --- a/web/pgadmin/static/js/tree/tree_init.tsx +++ b/web/pgadmin/static/js/tree/tree_init.tsx @@ -73,10 +73,11 @@ var initBrowserTree = async (pgBrowser) => { await treeModelX.root.ensureLoaded() + let tree_height = window.outerHeight - 300; // Render Browser Tree await render(
-
, document.getElementById('tree')); } diff --git a/web/pgadmin/tools/search_objects/static/js/search_objects_dialog_wrapper.js b/web/pgadmin/tools/search_objects/static/js/search_objects_dialog_wrapper.js index 62d37edc1..f8249a892 100644 --- a/web/pgadmin/tools/search_objects/static/js/search_objects_dialog_wrapper.js +++ b/web/pgadmin/tools/search_objects/static/js/search_objects_dialog_wrapper.js @@ -288,7 +288,9 @@ export default class SearchObjectsDialogWrapper extends DialogWrapper { this.showMessage(gettext('Locating...')); tree.findNodeWithToggle(rowData.id_path) .then((treeItem)=>{ - tree.select(treeItem, true); + setTimeout(() => { + tree.select(treeItem, true); + }, 100); this.showMessage(null); }) .catch((error)=>{