Repository navigation
fix: keep popup clicks inside closed shadow roots - #1258
feritcemkahraman wants to merge 2 commits into
Conversation
|
@feritcemkahraman is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. WalkthroughBaseSelect 在弹出层点击分支中将原始事件目标写入原生事件的 Changes闭合 Shadow DOM 点击处理
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1258 +/- ##
=======================================
Coverage 99.46% 99.46%
=======================================
Files 31 31
Lines 1304 1305 +1
Branches 476 476
=======================================
+ Hits 1297 1298 +1
Misses 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
||
| // We should give focus back to selector if clicked item is not focusable | ||
| if (popupElement?.contains(target as HTMLElement) && triggerOpen) { | ||
| (event.nativeEvent as any)._ori_target = target; |
There was a problem hiding this comment.
This appears to be a non-standard approach; is there a more standard solution?
When a Select popup is rendered in a closed shadow root, clicking inside the popup can close it: the window listener sees the shadow host instead of the clicked element. Preserve the original popup target on the existing mousedown marker so inside clicks stay open and outside clicks still close it. Ref: #1054.
pnpm exec rc-test --runInBand: 451 tests and 21 snapshots passed, including a real portal into a separate closed shadow root (jsdom).tsc --noEmit: 7 errors in existing Jest matcher usages; no errors in the changed files. A real browser was not tested.Codex assisted with investigation, implementation, and tests.
Summary by CodeRabbit