On PC I can normally do multi-line inputs by using shift-Enter, but on phone/tablet the "Send" button is always hoovered, so by pressing Enter on keyboard text is sent. This happens because button is binded on Enter if typing more stuff in a row for convenience.
On phone/tablet, this should not be the case.
This function should work just fine do detect the device (and remove binding in case of phone/tablet):
function isMobileDevice() {
// For modern browsers with User-Agent Client Hints
if (navigator.userAgentData) {
return navigator.userAgentData.mobile;
}
// Fallback for older browsers
return /Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
}
On PC I can normally do multi-line inputs by using shift-Enter, but on phone/tablet the "Send" button is always hoovered, so by pressing Enter on keyboard text is sent. This happens because button is binded on Enter if typing more stuff in a row for convenience.
On phone/tablet, this should not be the case.
This function should work just fine do detect the device (and remove binding in case of phone/tablet):