From f09e049bc5fc17ea5e96dfc94cea6a6a42d60302 Mon Sep 17 00:00:00 2001
From: Simon Malesys <simon.malesys@pasteur.fr>
Date: Tue, 19 Mar 2024 10:51:39 +0100
Subject: [PATCH] Auto scroll to the phenotypes table after ancestry selection

---
 client/.eslintrc.js   |  3 ++-
 client/pages/gwas.vue | 12 +++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/client/.eslintrc.js b/client/.eslintrc.js
index 3b7301d8..137da503 100644
--- a/client/.eslintrc.js
+++ b/client/.eslintrc.js
@@ -18,6 +18,7 @@ module.exports = {
   // add your custom rules here
   rules: {
     "no-unused-vars": "off",
-    'no-console': 'off'
+    'no-console': 'off',
+    'vue/valid-v-slot': 'off'
   }
 }
diff --git a/client/pages/gwas.vue b/client/pages/gwas.vue
index c9b643dd..a69bb300 100644
--- a/client/pages/gwas.vue
+++ b/client/pages/gwas.vue
@@ -37,7 +37,7 @@
       </div>
     </section>
 
-    <section v-show="phenotypes.length">
+    <section id="phenotypes-section" v-show="phenotypes.length">
       <h2>Select at least two GWASs to be analyzed jointly:</h2>
       <v-data-table
         v-model="selectedRows"
@@ -101,6 +101,16 @@ export default {
         .then(phenotypes => {
           this.phenotypes = phenotypes
         })
+        .then(() => {
+          // Scroll to the phenotype table after it appeared
+          document
+            .getElementById("phenotypes-section")
+            .scrollIntoView({
+              behavior: 'smooth',
+              block: 'start',
+              inline: 'nearest'
+            })
+        })
     },
     bulkSelect({ item: b, value }) {
       const { selectedRows, current, shiftKeyOn } = this;
-- 
GitLab