From 9bd6e057b392f60cf31ae258ec46ac50b052697d Mon Sep 17 00:00:00 2001 From: Florrie Date: Sat, 8 Jun 2019 15:58:22 -0300 Subject: Reset selection index when clearing queue --- ui.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui.js b/ui.js index 7056506..6f78b16 100644 --- a/ui.js +++ b/ui.js @@ -719,7 +719,7 @@ class AppElement extends FocusElement { this.queueGrouplike.items = this.queueGrouplike.items .filter(item => item === this.playingTrack) this.queueListingElement.buildItems() - this.queueListingElement.pathElement.showItem(null) + this.queueListingElement.selectNone() this.updateQueueLengthLabel() } @@ -1411,6 +1411,12 @@ class GrouplikeListingElement extends Form { if (this.root.select) this.hideJumpElement() } + selectNone() { + this.pathElement.showItem(null) + this.form.curIndex = 0 + this.form.scrollItems = 0 + } + buildItems(resetIndex = false) { if (!this.grouplike) { throw new Error('Attempted to call buildItems before a grouplike was loaded') -- cgit 1.3.0-6-gf8a5