From a7aa1fa5ec187e23ca82d77e08c29f984981e9eb Mon Sep 17 00:00:00 2001 From: Samuel Elliott Date: Wed, 4 Apr 2018 20:34:54 +0100 Subject: [PATCH 01/13] Fix up/down at the end of the list when the list has less than 10 emotes --- client/src/ui/components/common/Autocomplete.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/ui/components/common/Autocomplete.vue b/client/src/ui/components/common/Autocomplete.vue index 26323803..4b831fa6 100644 --- a/client/src/ui/components/common/Autocomplete.vue +++ b/client/src/ui/components/common/Autocomplete.vue @@ -113,11 +113,11 @@ traverse(e) { if (!this.open) return; if (e.key === 'ArrowUp') { - this.selectedIndex = (this.selectedIndex - 1) < 0 ? 9 : this.selectedIndex - 1; + this.selectedIndex = (this.selectedIndex - 1) < 0 ? Math.min(this.emotes.length, 10) - 1 : this.selectedIndex - 1; return; } if (e.key === 'ArrowDown') { - this.selectedIndex = (this.selectedIndex + 1) >= 10 ? 0 : this.selectedIndex + 1; + this.selectedIndex = (this.selectedIndex + 1) >= Math.min(this.emotes.length, 10) ? 0 : this.selectedIndex + 1; return; } return; From a96f3b1eb7eb56bd427b6b7fd8d43a11ad6e6602 Mon Sep 17 00:00:00 2001 From: Samuel Elliott Date: Wed, 4 Apr 2018 20:36:11 +0100 Subject: [PATCH 02/13] Fix border radius of the message input field --- client/src/styles/partials/generic/autocomplete.scss | 5 +++++ client/src/ui/automanip.js | 2 +- client/src/ui/components/common/Autocomplete.vue | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/styles/partials/generic/autocomplete.scss b/client/src/styles/partials/generic/autocomplete.scss index 75312e1e..0ee51fac 100644 --- a/client/src/styles/partials/generic/autocomplete.scss +++ b/client/src/styles/partials/generic/autocomplete.scss @@ -77,4 +77,9 @@ } } } + + &.bd-active + [class*="inner"] { + border-top-left-radius: 0; + border-top-right-radius: 0; + } } diff --git a/client/src/ui/automanip.js b/client/src/ui/automanip.js index 5c8e72dd..b24e6784 100644 --- a/client/src/ui/automanip.js +++ b/client/src/ui/automanip.js @@ -185,7 +185,7 @@ export default class extends EventListener { const root = document.createElement('span'); const parent = document.querySelector('[class*="channelTextArea"] > [class*="inner"]'); if (!parent) return; - parent.append(root); + parent.parentElement.insertBefore(root, parent); VueInjector.inject(root, { components: { Autocomplete }, data: { initial: e.target.value }, diff --git a/client/src/ui/components/common/Autocomplete.vue b/client/src/ui/components/common/Autocomplete.vue index 4b831fa6..987d2f53 100644 --- a/client/src/ui/components/common/Autocomplete.vue +++ b/client/src/ui/components/common/Autocomplete.vue @@ -9,7 +9,7 @@ */