Skip to content

fix(clerk-js): Update createFlexGapPropertyIosCompat user agent regex check#4034

Merged
brkalow merged 9 commits intomainfrom
alexcarpenter/sdki-626-bug-ui-components-in-ios-google-chrome-are-rendering
Aug 27, 2024
Merged

fix(clerk-js): Update createFlexGapPropertyIosCompat user agent regex check#4034
brkalow merged 9 commits intomainfrom
alexcarpenter/sdki-626-bug-ui-components-in-ios-google-chrome-are-rendering

Conversation

@alexcarpenter
Copy link
Copy Markdown
Member

@alexcarpenter alexcarpenter commented Aug 27, 2024

Description

Fixes issue where createFlexGapPropertyIosCompat was incorrectly detecting a chrome browser agent.

Chrome user agent example:

"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/128.0.6613.92 Mobile/15E148 Safari/604.1"

Our regex was matching the 13 here 128.0.6613.92

iOS Chrome:

BEFORE AFTER
IMG_2198 IMG_2199

Fixes SDKI-626

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Aug 27, 2024

🦋 Changeset detected

Latest commit: b77607f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@alexcarpenter
Copy link
Copy Markdown
Member Author

!preview

@clerk-cookie
Copy link
Copy Markdown
Collaborator

clerk-cookie commented Aug 27, 2024

Hey @alexcarpenter, your preview is available.

Status Preview Updated (UTC)
🍪 Deployed Visit preview Aug 27, 2024 06:35 PM

@alexcarpenter
Copy link
Copy Markdown
Member Author

!preview

@alexcarpenter alexcarpenter changed the title fix(clerk-js): Update flex gap compat to use css @supports fix(clerk-js): Update createFlexGapPropertyIosCompat user agent check Aug 27, 2024
@alexcarpenter alexcarpenter marked this pull request as ready for review August 27, 2024 21:00
@alexcarpenter alexcarpenter requested a review from brkalow August 27, 2024 21:02
@alexcarpenter alexcarpenter changed the title fix(clerk-js): Update createFlexGapPropertyIosCompat user agent check fix(clerk-js): Update createFlexGapPropertyIosCompat user agent regex check Aug 27, 2024
// This is not needed for css grid, only for flex
// TODO: Test whether we need to make the check more generic
if (navigator?.userAgent?.match(/(iphone|ipad).+os.+13.+safari/i)) {
if (navigator?.userAgent?.match(/(iphone|ipad).+(os).*(\s13).+safari/i)) {
Copy link
Copy Markdown
Member Author

@alexcarpenter alexcarpenter Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the main fix here:

- navigator?.userAgent?.match(/(iphone|ipad).+os.+13.+safari/i)
+ navigator?.userAgent?.match(/(iphone|ipad).+(os).*(\s13_).+safari/i)

Comment on lines +6 to 9
'& > *:not([hidden]):not([style*="visibility: hidden"]) + *:not([hidden]):not([style*="visibility: hidden"])': {
marginLeft: dir === 'row' ? val : undefined,
marginTop: dir === 'col' ? val : undefined,
},
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This update was to improve the layout rendering for the fallback:

BEFORE AFTER
Screenshot 2024-08-27 at 5 10 36 PM Screenshot 2024-08-27 at 5 11 21 PM

Comment thread packages/clerk-js/src/ui/primitives/gapPropertyCompat.ts Outdated
Comment thread .changeset/nine-spies-own.md Outdated
@brkalow brkalow enabled auto-merge (squash) August 27, 2024 21:17
@brkalow brkalow merged commit 3d6f992 into main Aug 27, 2024
@brkalow brkalow deleted the alexcarpenter/sdki-626-bug-ui-components-in-ios-google-chrome-are-rendering branch August 27, 2024 21:46
alexcarpenter added a commit that referenced this pull request Aug 28, 2024
…ex check (#4034)

Co-authored-by: Bryce Kalow <bryce@clerk.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants