This commit is contained in:
Andrew Gundersen 2022-01-18 16:58:56 -06:00
commit 5d74c67648
17 changed files with 101 additions and 212 deletions

View file

@ -7,13 +7,11 @@ const initScroll = (elementId) => {
}
const isBottom = () => {
if (el) {
return el.scrollHeight - el.clientHeight <= el.scrollTop + 1;
}
return el.scrollHeight - el.clientHeight <= el.scrollTop + 1;
}
const adjustScroll = () => {
if (el) {
if (isBottom()) {
el.scrollTo({
top: el.scrollHeight - el.clientHeight,
behavior: 'smooth'

View file

@ -35,7 +35,7 @@ function useText(elementId, left, typing)
window.addEventListener("keydown", (e) => {
if (!show.value && !metaKeys.includes(e.key))
if (!show.value && !metaKeys.includes(e.key) && !e.ctrlKey)
{
show.value = true;
}
@ -47,7 +47,7 @@ function useText(elementId, left, typing)
if (e.key === "Enter" && el.value)
{
window.mainApi.send("message", {
category: "text/plain",
category: "text",
text: el.value,
blob: null
});