From 05640e4cc16693be2712a2c5aaf46d3305c37fcb Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 9 Oct 2022 23:02:39 +0300 Subject: [PATCH] cleanup --- src/components/emoji_input/emoji_input.js | 22 +------------------ .../post_status_form/post_status_form.js | 3 --- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js index b365043c..46f04c60 100644 --- a/src/components/emoji_input/emoji_input.js +++ b/src/components/emoji_input/emoji_input.js @@ -139,8 +139,6 @@ const EmojiInput = { return this.modelValue.slice(this.caret) }, showSuggestions () { - console.log(this.focused) - console.log(this.suggestions) return this.focused && this.suggestions && this.suggestions.length > 0 && @@ -227,11 +225,8 @@ const EmojiInput = { input.addEventListener('click', this.onClickInput) input.addEventListener('transitionend', this.onTransition) input.addEventListener('input', this.onInput) + // FIXME LEAK input.addEventListener('scroll', (e) => { - console.log({ - top: this.input.scrollTop, - left: this.input.scrollLeft - }) this.$refs.hiddenOverlay.scrollTo({ top: this.input.scrollTop, left: this.input.scrollLeft @@ -278,12 +273,6 @@ const EmojiInput = { img: imageUrl || '' })) this.$refs.suggestorPopover.updateStyles() - }, - suggestions: { - handler (newValue) { - this.$nextTick(this.resize) - }, - deep: true } }, methods: { @@ -450,16 +439,12 @@ const EmojiInput = { } }) }, - onTransition (e) { - this.resize() - }, onBlur (e) { // Clicking on any suggestion removes focus from autocomplete, // preventing click handler ever executing. this.blurTimeout = setTimeout(() => { this.focused = false this.setCaret(e) - this.resize() }, 200) }, onClick (e, suggestion) { @@ -476,13 +461,11 @@ const EmojiInput = { } this.focused = true this.setCaret(e) - this.resize() this.temporarilyHideSuggestions = false }, onKeyUp (e) { const { key } = e this.setCaret(e) - this.resize() // Setting hider in keyUp to prevent suggestions from blinking // when moving away from suggested spot @@ -494,7 +477,6 @@ const EmojiInput = { }, onPaste (e) { this.setCaret(e) - this.resize() }, onKeyDown (e) { const { ctrlKey, shiftKey, key } = e @@ -541,12 +523,10 @@ const EmojiInput = { } this.showPicker = false - this.resize() }, onInput (e) { this.showPicker = false this.setCaret(e) - this.resize() this.$emit('update:modelValue', e.target.value) }, onClickInput (e) { diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 5c536b74..eb55cfcc 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -501,7 +501,6 @@ const PostStatusForm = { if (target.value === '') { target.style.height = null this.$emit('resize') - this.$refs['emoji-input'].resize() return } @@ -588,8 +587,6 @@ const PostStatusForm = { } else { scrollerRef.scrollTop = targetScroll } - - this.$refs['emoji-input'].resize() }, showEmojiPicker () { this.$refs.textarea.focus()