Skip to content

On phone/table can not do multi-line #1

@DotaPie

Description

@DotaPie

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions