fix: open tooltip on click when anchor stops propagation#1275
fix: open tooltip on click when anchor stops propagation#1275danielbarion wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR enables tooltip click handlers to register in the capture phase of the DOM event flow, allowing them to receive click events before anchor elements can stop propagation. The event delegation infrastructure was refactored to support ChangesTooltip Capture-Phase Event Delegation
Sequence DiagramsequenceDiagram
participant Browser
participant TooltipDelegatedListener as Tooltip<br/>Capture Handler
participant Anchor
participant OtherHandlers as Other<br/>Handlers
Browser->>TooltipDelegatedListener: 1. Click (capture phase)
TooltipDelegatedListener->>TooltipDelegatedListener: Opens tooltip
Browser->>Anchor: 2. Click (bubbling phase)
Anchor->>Anchor: stopPropagation()
Note over OtherHandlers: 3. Blocked by stopPropagation
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/components/Tooltip/event-delegation.tsOops! Something went wrong! :( ESLint: 10.2.0 TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module "file:///.eslintrc.json?mtime=1779826179640" needs an import attribute of "type: json" src/components/Tooltip/use-tooltip-events.tsxOops! Something went wrong! :( ESLint: 10.2.0 TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module "file:///.eslintrc.json?mtime=1779826179640" needs an import attribute of "type: json" src/test/tooltip-interaction-behavior.spec.jsOops! Something went wrong! :( ESLint: 10.2.0 TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module "file:///.eslintrc.json?mtime=1779826179640" needs an import attribute of "type: json" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Beta version released with the last commit 🚀 or |
closes #1274
Summary by CodeRabbit