Skip to content

A platform for community discussion. Free, open, simple.

FIX: allows to focus thread's composer on ipad (#22639)

Joffrey JAFFEUXfe8d9b6b4e42
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-composer.js b/plugins/chat/assets/javascripts/discourse/components/chat-composer.js
index 304cd235719..0bb149018df 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-composer.js
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-composer.js
@@ -276,9 +276,9 @@ export default class ChatComposer extends Component {
return;
}
- // hack to prevent the whole viewport
- // to move on focus input
- textarea = document.querySelector(".chat-composer__input");
+ // hack to prevent the whole viewport to move on focus input
+ // we need access to native node
+ textarea = this.composer.textarea.textarea;
textarea.style.transform = "translateY(-99999px)";
textarea.focus();
window.requestAnimationFrame(() => {