Skip to content

fix: fix iPhone and iPad detection when platform hint is iOS - #11008

Open
reidbarber wants to merge 2 commits into
mainfrom
fix-navigator-userAgentData
Open

reidbarber wants to merge 2 commits into
mainfrom
fix-navigator-userAgentData

Conversation

@reidbarber

@reidbarber reidbarber commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Closes #10980

Summary

This is a forward-compatible fix to keep our iOS-specific behavior working if/when WebKit enables navigator.userAgentData by default.

WebKit’s implementation of it returns "iOS" for both iPhone and iPad. We currently prefer navigator.userAgentData over navigator.platform, so whenever they enable that feature, neither device check will match. With this change, for "iOS", we fall back to navigator.platform to distinguish the two devices.

📝 Test Instructions

Unit tests should cover, but we can smoke test device check stories.

Release impact

  • Only changes docs, tests, CI, or development tools. Nothing shipped to users changes.
  • Fixes a bug or improves existing code without changing how apps use it.
  • Adds a feature or API while keeping existing usage working.
  • May break existing usage or require changes in apps that use this code.

✅ PR Checklist

  • I followed the contributing guide.
  • I tested this change locally and included the results in Test Instructions, or explained why testing does not apply.
  • I understand and can explain every change in this PR. If I used AI assistance, I followed the AI contribution guidance.

🧢 Your Project

@reidbarber reidbarber changed the title fix(react-aria): fix iPhone and iPad detection when platform hint is iOS fix: fix iPhone and iPad detection when platform hint is iOS Nov 20, 2026
@rspbot

rspbot commented Nov 20, 2026

Copy link
Copy Markdown

@rspbot

rspbot commented Nov 20, 2026

Copy link
Copy Markdown

Agent Skills Changes

Modified (9)
Install

React Spectrum S2:

npx skills add https://d1pzu54gtk2aed.cloudfront.net/pr/a6e05d39691adce38282d74d61e439f51ea67bf1/

React Aria:

npx skills add https://d5iwopk28bdhl.cloudfront.net/pr/a6e05d39691adce38282d74d61e439f51ea67bf1/

@snowystinger

Copy link
Copy Markdown
Member

any idea how to turn on the preview of this feature as well?

@nwidynski

nwidynski commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

In my opinion, this is a bit early for RSP to consider. The standards position on User Agent Client Hints (the official spec name for userAgentData) is not even affirmed yet. See WebKit/standards-positions#70

PS: Its not a big change per se, but I just wanted to have that considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isIPhone() and isIOS() return false on iPhone when navigator.userAgentData.platform is "iOS"

4 participants