Compare commits
No commits in common. "f8af8a78fcb72bb882dd30e28e80d38ab8ec3709" and "8b14ff2c96e288003ae6a87f5e5c490334c940c7" have entirely different histories.
f8af8a78fc
...
8b14ff2c96
2 changed files with 9 additions and 24 deletions
|
@ -97,20 +97,14 @@
|
||||||
|
|
||||||
|
|
||||||
// Focus the text area when the component first loads, or when the user selects another channel
|
// Focus the text area when the component first loads, or when the user selects another channel
|
||||||
const focusTextarea = () => {
|
const focusTextarea = () => messageTextarea && messageTextarea.focus();
|
||||||
if (messageTextarea && getItem("ui:useragent:formFactor") !== "touch") {
|
|
||||||
messageTextarea.focus();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
onMount(focusTextarea);
|
onMount(focusTextarea);
|
||||||
unsubscribers.push(selectedChannel.watch(focusTextarea));
|
unsubscribers.push(selectedChannel.subscribe(focusTextarea));
|
||||||
|
|
||||||
// Handle the setMessageInput event
|
// Handle the setMessageInput event
|
||||||
unsubscribers.push(setMessageInputEvent.watch((value) => {
|
unsubscribers.push(setMessageInputEvent.watch((value) => {
|
||||||
messageInput = value;
|
messageInput = value;
|
||||||
if (messageTextarea) {
|
focusTextarea();
|
||||||
messageTextarea.focus();
|
|
||||||
}
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,21 +9,12 @@ function initViewportSizeHandler() {
|
||||||
root.style.setProperty("--viewportWidth", "100dvw");
|
root.style.setProperty("--viewportWidth", "100dvw");
|
||||||
root.style.setProperty("--viewportHeight", "100dvh");
|
root.style.setProperty("--viewportHeight", "100dvh");
|
||||||
} else if (method === "javascriptResponsive") {
|
} else if (method === "javascriptResponsive") {
|
||||||
if (window.visualViewport) {
|
|
||||||
const updateUnits = () => {
|
|
||||||
root.style.setProperty("--viewportWidth", `${window.visualViewport.width}px`);
|
|
||||||
root.style.setProperty("--viewportHeight", `${window.visualViewport.height}px`);
|
|
||||||
};
|
|
||||||
window.visualViewport.addEventListener("resize", updateUnits);
|
|
||||||
updateUnits();
|
|
||||||
} else {
|
|
||||||
const updateUnits = () => {
|
const updateUnits = () => {
|
||||||
root.style.setProperty("--viewportWidth", `${window.innerWidth}px`);
|
root.style.setProperty("--viewportWidth", `${window.innerWidth}px`);
|
||||||
root.style.setProperty("--viewportHeight", `${window.innerHeight}px`);
|
root.style.setProperty("--viewportHeight", `${window.innerHeight}px`);
|
||||||
};
|
};
|
||||||
window.addEventListener("resize", updateUnits);
|
window.addEventListener("resize", updateUnits);
|
||||||
updateUnits();
|
updateUnits();
|
||||||
}
|
|
||||||
} else if (method === "normalUnits") {
|
} else if (method === "normalUnits") {
|
||||||
root.style.setProperty("--viewportWidth", "100vw");
|
root.style.setProperty("--viewportWidth", "100vw");
|
||||||
root.style.setProperty("--viewportHeight", "100vh");
|
root.style.setProperty("--viewportHeight", "100vh");
|
||||||
|
|
Loading…
Reference in a new issue