From b3efaf7041757418c9cf0a4965fc00416423be87 Mon Sep 17 00:00:00 2001 From: Th3Dilli Date: Thu, 19 Jun 2025 01:37:29 +0200 Subject: [PATCH] bugfix: fix BTTV and 7TV emote inline preview rendering while "Display Room Actions above the chat input box" is enabled --- src/sites/twitch-twilight/modules/chat/input.jsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/sites/twitch-twilight/modules/chat/input.jsx b/src/sites/twitch-twilight/modules/chat/input.jsx index d995d40b..a5df1d3d 100644 --- a/src/sites/twitch-twilight/modules/chat/input.jsx +++ b/src/sites/twitch-twilight/modules/chat/input.jsx @@ -235,7 +235,14 @@ export default class Input extends Module { async onEnable() { this.chat.context.on('changed:chat.hype.display-input', () => this.ChatInput.forceUpdate()); this.chat.context.on('changed:chat.actions.room', () => this.ChatInput.forceUpdate()); - this.chat.context.on('changed:chat.actions.room-above', () => this.ChatInput.forceUpdate()); + this.chat.context.on('changed:chat.actions.room-above', () => { + this.ChatInput.forceUpdate(); + if ( this.use_previews ) + for(const inst of this.ChatInput.instances) { + this.removePreviewObserver(inst); + this.installPreviewObserver(inst); + } + }); this.chat.context.on('changed:chat.tab-complete.emotes-without-colon', enabled => { for (const inst of this.EmoteSuggestions.instances) inst.canBeTriggeredByTab = enabled; @@ -417,8 +424,9 @@ export default class Input extends Module { if ( ! this.use_previews ) return; - const el = this.fine.getHostNode(inst), - target = el && el.querySelector('.chat-input__textarea'); + const el = this.fine.getHostNode(inst); + const above = this.chat.context.get('chat.actions.room-above'); + const target = above && el ? el : el.querySelector('.chat-input__textarea'); if ( ! target ) return;