diff options
| author | Henry Jameson <me@hjkos.com> | 2019-11-08 21:28:51 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-11-08 21:28:51 +0200 |
| commit | a43f1614ca3bdf9b8b2d61e5945358b5da517b0f (patch) | |
| tree | c84e602b5a24896fc99c42e22265f7085acad309 /src/components/emoji_picker/emoji_picker.js | |
| parent | 9338c81f4a68d217a70ffeefc4faab130d965df5 (diff) | |
fix not being able to see unicode emojis when there few of them when searching
on emoji-a-ton instances
Diffstat (limited to 'src/components/emoji_picker/emoji_picker.js')
| -rw-r--r-- | src/components/emoji_picker/emoji_picker.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index 92abf7a2..782c4dfc 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -77,13 +77,14 @@ const EmojiPicker = { const scrollerBottom = target.scrollTop + target.clientHeight const scrollerTop = target.scrollTop + const scrollerMax = target.scrollHeight // Loads more emoji when they come into view const approachingBottom = bottom - scrollerBottom < LOAD_EMOJI_MARGIN // Always load when at the very top in case there's no scroll space yet const atTop = scrollerTop < 5 - // Don't load when looking at unicode category - const bottomAboveViewport = bottom < scrollerTop + // Don't load when looking at unicode category or at the very bottom + const bottomAboveViewport = bottom < scrollerTop || scrollerBottom === scrollerMax if (!bottomAboveViewport && (approachingBottom || atTop)) { this.loadEmoji() } @@ -126,6 +127,7 @@ const EmojiPicker = { watch: { keyword () { this.customEmojiLoadAllConfirmed = false + this.$refs['emoji-groups'].scrollTop = 0 this.onScroll() this.startEmojiLoad(true) } |
