« get me outta code hell

Keep selected item in view (wrt shift selecting) - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2019-08-27 17:04:09 -0300
committerFlorrie <towerofnix@gmail.com>2019-08-27 17:04:09 -0300
commit88d42caf4aaa5aa5a235b8f434704bbe8f6a9f92 (patch)
tree18b2bc9d3c9d7acc4f75a186fe11721bdbca6936
parent69736b797c5058f526a359e24f4b43020c0c7236 (diff)
Keep selected item in view (wrt shift selecting)
-rw-r--r--todo.txt9
-rw-r--r--ui.js1
2 files changed, 10 insertions, 0 deletions
diff --git a/todo.txt b/todo.txt
index 0a3d5e6..af17769 100644
--- a/todo.txt
+++ b/todo.txt
@@ -274,3 +274,12 @@ TODO: Work out frame rate shenanigans. :) This is a huge task, though (to get
       it exactly right) - to begin, just make it so telnet and ordinary clients
       get different framerates.
       (Done!)
+
+TODO: Remember the scroll position of each group. This should probably be done
+      per-listing, but make sure the data disappears when the listing is
+      destroyed (e.g. tab closed)! Have maps on the listings instead of the
+      grouplikes themselves.
+
+TODO: Apparently shift-up/down selecting doesn't keep the selected item within
+      the scroll view. Fix that.
+      (Done!)
diff --git a/ui.js b/ui.js
index 3102dfb..3f9611e 100644
--- a/ui.js
+++ b/ui.js
@@ -1570,6 +1570,7 @@ class GrouplikeListingForm extends ListScrollForm {
       } else {
         this.previousInput()
       }
+      this.scrollSelectedElementIntoView()
     }
 
     const getItem = () => {