Skip to content

Incorrect mobile device detection - touch screen laptops trigger mobile UI behavior #1767

@calycekr

Description

@calycekr

Bug description

The current mobile device detection logic incorrectly identifies laptops with touch screen functionality as mobile devices, resulting in the mobile user interface being displayed. This impacts usability on laptops with touch screen.

Submitting messages via enter key doesn't work, etc.

Steps to reproduce

  1. Access the application on a laptop with a touch screen.
  2. Observe the user interface behavior.
  3. Submitting messages via enter key doesn't work.

Notes

I think root causes are in function isVirtualKeyboard() in ChatInput.svelte

function isVirtualKeyboard(): boolean {
if (!browser) return false;
// Check for touch capability
if (navigator.maxTouchPoints > 0) return true;
// Check for touch events
if ("ontouchstart" in window) return true;
// Fallback to user agent string check
const userAgent = navigator.userAgent.toLowerCase();
return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent);
}

#1635

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrontThis issue is related to the front-end of the app.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions