<SignIn />: first "Use email" click switches back to phone when `initialValues.phoneNumber` is set
維護者通常 1 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 74/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- react, typescript
研究方向
從 packages/ui/src/components/SignIn/SignInStart.tsx 開始,特別查看 textIdentifierField 的初始化,以及 issue 中描述的自動填入 effect。追蹤點擊「使用電子郵件」時與 handlePhoneNumberPaste 的互動;重現連結可用來確認此行為。完成條件是:第一次點擊後顯示預先填入電話號碼的電子郵件欄位,且有回歸測試涵蓋此情況。
由索引模型根據 Issue 內容生成。
描述
Preliminary Checks
- I have reviewed the documentation: https://clerk.com/docs
- I have searched for existing issues: https://github.com/clerk/javascript/issues
- I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
- This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Reproduction
https://github.com/twicestruck/clerk-signin-phone-prefill-repro
Publishable key
pk_test_ZXhwZXJ0LXVuaWNvcm4tNzgyOC5jbGVyay5hY2NvdW50cy5kZXYk
Description
With email and phone both enabled as sign-in identifiers, <SignIn initialValues={{ phoneNumber: '+15555550100' }} /> opens on the phone field as expected, but the first "Use email" click switches straight back to the phone field. The second click works.
Steps to reproduce:
- Run the reproduction with the publishable key above
- Click "Use email" once
Expected behavior:
The email field shows.
Actual behavior:
The form switches back to the phone field.
Cause: when the form starts on the phone field, SignInStart seeds textIdentifierField with initialValues[identifierAttribute], which is the phone number (source). After the switch, the autofill effect sees a value starting with + and calls handlePhoneNumberPaste, which switches back to the phone field and clears the email field, so the second click sticks. A prefilled number without + shows up in the email field instead.
I'll open a PR with a fix and a test.
Environment
System:
OS: macOS 27.0.1
CPU: (18) arm64 Apple M5 Max
Memory: 157.16 MB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.22.0
npm: 11.19.1
pnpm: 12.14.0
bun: 1.4.3
Browsers:
Brave Browser: 155.1.97.59
Chrome: 155.0.8059.85
Chrome Canary: 158.0.8110.0
Firefox: 158.0
Safari: 27.0.1
npmPackages:
@clerk/react: 6.18.3 => 6.18.3
@vitejs/plugin-react: 6.1.2 => 6.1.2
react: 19.3.1 => 19.3.1
react-dom: 19.3.1 => 19.3.1
vite: 8.3.5 => 8.3.5
- 主要語言
- TypeScript
- 星號
- 1.8k
- 分支
- 484
- 平均合併
- 1 天 7 小時
- 30 天內合併 PR
- 350
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
clerk/javascript 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 75/100
clerk/javascript#10548 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
clerk/javascript#10547 ·
維護者通常 1 天內回覆
-
useLoadedIsomorphicClerk misses "ready" when a ClerkProvider remounts after clerk-js has loaded — <ClerkLoading> never resolves可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
clerk/javascript#10462 ·
維護者通常 1 天內回覆
-
ClerkAPIError drops meta.lockout_expires_in_seconds from user_locked errors可能已有人在做 @umeraamir69 於 11 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
clerk/javascript#10026 · 2 則留言 ·
維護者通常 1 天內回覆
-
@clerk/nextjs: onBeforeSetActive never settles when invalidateCacheAction rejects (e.g. after a redeploy), so setActive and signOut hang forever可能已有人在做 @RaphaelFakhri 於 28 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
clerk/javascript#9987 · 1 則留言 ·
維護者通常 1 天內回覆
相似的 Issue
-
mobile-app
難度 2/5 1-3 小時 新手友好度 74/100
Open-Locker/Open-Locker#352 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
leanprover-community/lean4game#589 ·
維護者通常 2 天內回覆
-
check:passed streams:add
難度 1/5 1 小時以內 新手友好度 68/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 82/100
維護者通常 1 天內回覆