I was able to get iPad detection working by checking for navigator.maxTouchPoints
as well as navigator.platform
. It’s not perfect (as discussed in the comments below) but it’s the best solution I’ve come across so far so I wanted to share.
const iPad = (userAgent.match(/(iPad)/) /* iOS pre 13 */ ||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) /* iPad OS 13 */);