Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hidden native emote menu style #6897

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/modules/emote_menu/twitch/EmoteMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import styles from './EmoteMenu.module.css';
const CONTAINER_QUERY_SELECTOR = '#root';
const CHAT_TEXT_AREA = 'textarea[data-a-target="chat-input"], div[data-a-target="chat-input"]';
const CHAT_TEXT_AREA_CONTAINER = '.chat-input__textarea';
const CHAT_INPUT = '.chat-input';

// For legacy button
const LEGACY_BTTV_EMOTE_PICKER_BUTTON_CONTAINER_ID = 'bttv-legacy-emote-picker-button-container';
Expand Down Expand Up @@ -100,8 +101,9 @@ function unloadButton(container, chatTextAreaContainer) {
if (chatTextAreaContainer === undefined) {
chatTextAreaContainer = document.querySelector(CHAT_TEXT_AREA_CONTAINER);
}
if (chatTextAreaContainer != null) {
chatTextAreaContainer.classList.remove(styles.hideEmoteMenuButtonContainer);
const chatInput = document.querySelector(CHAT_INPUT);
if (chatInput != null) {
chatInput.classList.remove(styles.hideEmoteMenuButtonContainer);
}
if (container != null) {
container.remove();
Expand Down Expand Up @@ -141,7 +143,12 @@ function loadButton() {
return;
}

chatTextAreaContainer.classList.add(styles.hideEmoteMenuButtonContainer);
const chatInput = document.querySelector(CHAT_INPUT);
if (chatInput == null) {
return;
}

chatInput.classList.add(styles.hideEmoteMenuButtonContainer);
const buttonContainer = document.createElement('div');
buttonContainer.setAttribute('id', BTTV_EMOTE_PICKER_BUTTON_CONTAINER_ID);
buttonContainer.classList.add(styles.container);
Expand Down
Loading