Touchscreen desktops detected as mobile

Anyone have advice for detecting touchscreen desktops?
Currently, using getPlatforms returns it as a mobile device.
Apparently this was not addressed with v5 as was suggested it might be earlier.

Can you elaborate any more on what exactly it is about a “touchscreen desktop” that you’re concerned about? I’m wondering if there is some sort of media query that might be useful for you.

I use platform detection to display different items and styling to users dependent upon their device.
The platform.platforms() returns mobile and mobileweb for phones, tablets etc… but it must use touchscreen capabilities to do this as my touch enabled desktop computer also returns as mobile.

Yes, I can use media queries to show/hide/style based on size and I use window.width as well but if a desktop user, with touchscreen, has their browser window open in a small width then that plan is out the window.

It is a small case scenario but still a thing.
So, I was looking to see if there is a different solution.
Ideally, using platforms but this seems to have not been deemed a necessary fix going into Ionic 5.

Hi just in case someone else is still trying to figure this out. Here is a solution that works for us. The touch screen PC is falsely detected as mobile, because Ionic detects it by media query '(any-pointer:coarse)'.

Here is my workaround:

  const platforms = getPlatforms();
  
  const isMobile = Boolean(
      /Android|webOS|iPhone|BlackBerry|IEMobile|Opera Mini/i.test(
        navigator.userAgent,
      ) && !platforms.includes("tablet"),
    )

This method is using user agent detection over media query. It might not cover all the possible edge cases, but it sure is more reliable. Also I’m exluding tablets using Ionic tablet detection. Hope this helps