summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings2/keyboard-shortcuts-controller.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-15 21:19:22 -0500
committerGitHub <noreply@github.com>2021-01-15 21:19:22 -0500
commitdc4d659184a61a55083e201438bff7732acece1b (patch)
treed3aa6cd09b32fed56cb00f42a172397e31aaa27a /ext/bg/js/settings2/keyboard-shortcuts-controller.js
parent1c5e53a7acec1b58bb2da370d47075a4a0b36ca9 (diff)
Update hotkey issues (#1244)
* Scroll to the bottom when adding inputs * Skip if empty action
Diffstat (limited to 'ext/bg/js/settings2/keyboard-shortcuts-controller.js')
-rw-r--r--ext/bg/js/settings2/keyboard-shortcuts-controller.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/bg/js/settings2/keyboard-shortcuts-controller.js b/ext/bg/js/settings2/keyboard-shortcuts-controller.js
index 83b457c8..42b36e86 100644
--- a/ext/bg/js/settings2/keyboard-shortcuts-controller.js
+++ b/ext/bg/js/settings2/keyboard-shortcuts-controller.js
@@ -30,6 +30,7 @@ class KeyboardShortcutController {
this._listContainer = null;
this._emptyIndicator = null;
this._stringComparer = new Intl.Collator('en-US'); // Invariant locale
+ this._scrollContainer = null;
}
get settingsController() {
@@ -44,6 +45,7 @@ class KeyboardShortcutController {
this._resetButton = document.querySelector('#hotkey-list-reset');
this._listContainer = document.querySelector('#hotkey-list');
this._emptyIndicator = document.querySelector('#hotkey-list-empty');
+ this._scrollContainer = document.querySelector('#keyboard-shortcuts .modal-body');
this._addButton.addEventListener('click', this._onAddClick.bind(this));
this._resetButton.addEventListener('click', this._onResetClick.bind(this));
@@ -65,6 +67,7 @@ class KeyboardShortcutController {
}]);
await this._updateOptions();
+ this._scrollContainer.scrollTop = this._scrollContainer.scrollHeight;
}
async deleteEntry(index) {