diff --git a/android/app/src/main/assets/public/main.js b/android/app/src/main/assets/public/main.js
index 41253048..ad507860 100644
--- a/android/app/src/main/assets/public/main.js
+++ b/android/app/src/main/assets/public/main.js
@@ -1908,16 +1908,19 @@ let touchStartY = 0;
let touchEndY = 0;
let touchMoved = false;
+let pressDate;
+
document.addEventListener('touchstart', e => {
touchStartX = e.changedTouches[0].screenX;
touchStartY = e.changedTouches[0].screenY;
touchMoved = false;
-
+
activeTouchButton = e.target.closest('button, input, textarea');
if (activeTouchButton) {
activeTouchButton.classList.add('is-pressed');
+ pressDate = Date.now();
}
-}, {passive: true});
+}, {passive: false});
document.addEventListener('touchmove', e => {
if (!touchMoved) {
@@ -1937,9 +1940,9 @@ document.addEventListener('touchmove', e => {
}
}
}
-}, {passive: true});
+}, {passive: false});
-document.addEventListener('touchend', e => {
+document.addEventListener('touchend', async (e) => {
touchEndX = e.changedTouches[0].screenX;
touchEndY = e.changedTouches[0].screenY;
@@ -1948,6 +1951,13 @@ document.addEventListener('touchend', e => {
handleMobileSwipe();
if (activeTouchButton) {
+
+ let elapsed = Date.now() - pressDate; //nie pomoglo ale zostawie
+ if (elapsed < 100) {
+ const remaining = 100 - elapsed;
+ await delay(remaining);
+ }
+
activeTouchButton.classList.remove('is-pressed');
if (!touchMoved) {
@@ -2440,7 +2450,7 @@ function setupChatScrollListener() {
let replyingToMsgId = null;
-async function sendMessage() {
+async function sendMessage(sendbutton) {
if (!currentDmId || !currentDmKey) return;
let input = document.getElementById("chat-input");
@@ -2475,6 +2485,7 @@ async function sendMessage() {
input.value = "";
input.style.height = '2.5rem';
+ sendbutton.style.height = '2.5rem';
window.forceScrollToBottom = true;
replyingToMsgId = null;
@@ -2517,11 +2528,15 @@ async function sendMessage() {
}
function handleChatInputResize(textarea) {
+ const sendbutton = textarea.parentElement.children.item(1);
+
const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
textarea.style.transition = 'none';
textarea.style.height = '0rem';
+ sendbutton.style.height = '0rem'; //test
let borderHeight = textarea.offsetHeight - textarea.clientHeight;
textarea.style.height = ((textarea.scrollHeight + borderHeight) / rem) + 'rem';
+ sendbutton.style.height = ((textarea.scrollHeight + borderHeight) / rem) + 'rem'; //test
textarea.offsetHeight; // force reflow
textarea.style.transition = '';
}
diff --git a/android/app/src/main/assets/public/screens.js b/android/app/src/main/assets/public/screens.js
index 50575755..1eb46ce0 100644
--- a/android/app/src/main/assets/public/screens.js
+++ b/android/app/src/main/assets/public/screens.js
@@ -143,9 +143,9 @@ var chatScreen = `
diff --git a/android/app/src/main/assets/public/style.css b/android/app/src/main/assets/public/style.css
index e0a209d7..626ab32d 100644
--- a/android/app/src/main/assets/public/style.css
+++ b/android/app/src/main/assets/public/style.css
@@ -171,6 +171,16 @@ indicator.active {
border-radius: 0.65rem;
}
+button {
+ overflow: hidden;
+}
+button svg {
+ pointer-events: none !important;
+}
+button img {
+ pointer-events: none !important;
+}
+
.reaction-pill {
backface-visibility: hidden;
transform: translateZ(0);
diff --git a/webroot/main.js b/webroot/main.js
index 41253048..ad507860 100644
--- a/webroot/main.js
+++ b/webroot/main.js
@@ -1908,16 +1908,19 @@ let touchStartY = 0;
let touchEndY = 0;
let touchMoved = false;
+let pressDate;
+
document.addEventListener('touchstart', e => {
touchStartX = e.changedTouches[0].screenX;
touchStartY = e.changedTouches[0].screenY;
touchMoved = false;
-
+
activeTouchButton = e.target.closest('button, input, textarea');
if (activeTouchButton) {
activeTouchButton.classList.add('is-pressed');
+ pressDate = Date.now();
}
-}, {passive: true});
+}, {passive: false});
document.addEventListener('touchmove', e => {
if (!touchMoved) {
@@ -1937,9 +1940,9 @@ document.addEventListener('touchmove', e => {
}
}
}
-}, {passive: true});
+}, {passive: false});
-document.addEventListener('touchend', e => {
+document.addEventListener('touchend', async (e) => {
touchEndX = e.changedTouches[0].screenX;
touchEndY = e.changedTouches[0].screenY;
@@ -1948,6 +1951,13 @@ document.addEventListener('touchend', e => {
handleMobileSwipe();
if (activeTouchButton) {
+
+ let elapsed = Date.now() - pressDate; //nie pomoglo ale zostawie
+ if (elapsed < 100) {
+ const remaining = 100 - elapsed;
+ await delay(remaining);
+ }
+
activeTouchButton.classList.remove('is-pressed');
if (!touchMoved) {
@@ -2440,7 +2450,7 @@ function setupChatScrollListener() {
let replyingToMsgId = null;
-async function sendMessage() {
+async function sendMessage(sendbutton) {
if (!currentDmId || !currentDmKey) return;
let input = document.getElementById("chat-input");
@@ -2475,6 +2485,7 @@ async function sendMessage() {
input.value = "";
input.style.height = '2.5rem';
+ sendbutton.style.height = '2.5rem';
window.forceScrollToBottom = true;
replyingToMsgId = null;
@@ -2517,11 +2528,15 @@ async function sendMessage() {
}
function handleChatInputResize(textarea) {
+ const sendbutton = textarea.parentElement.children.item(1);
+
const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
textarea.style.transition = 'none';
textarea.style.height = '0rem';
+ sendbutton.style.height = '0rem'; //test
let borderHeight = textarea.offsetHeight - textarea.clientHeight;
textarea.style.height = ((textarea.scrollHeight + borderHeight) / rem) + 'rem';
+ sendbutton.style.height = ((textarea.scrollHeight + borderHeight) / rem) + 'rem'; //test
textarea.offsetHeight; // force reflow
textarea.style.transition = '';
}
diff --git a/webroot/screens.js b/webroot/screens.js
index 50575755..1eb46ce0 100644
--- a/webroot/screens.js
+++ b/webroot/screens.js
@@ -143,9 +143,9 @@ var chatScreen = `
diff --git a/webroot/style.css b/webroot/style.css
index e0a209d7..626ab32d 100644
--- a/webroot/style.css
+++ b/webroot/style.css
@@ -171,6 +171,16 @@ indicator.active {
border-radius: 0.65rem;
}
+button {
+ overflow: hidden;
+}
+button svg {
+ pointer-events: none !important;
+}
+button img {
+ pointer-events: none !important;
+}
+
.reaction-pill {
backface-visibility: hidden;
transform: translateZ(0);