Fix handling of click events when anchor has nested elements#1246
Fix handling of click events when anchor has nested elements#1246gabrieljablonski merged 1 commit intomasterfrom
Conversation
WalkthroughThis pull request modifies the Tooltip component’s event handling logic. A new helper function, Changes
Sequence Diagram(s)Sequence Diagram - Open TooltipsequenceDiagram
participant U as User
participant T as Tooltip Component
participant H as activeAnchorContainsTarget
U->>T: Click event (open)
T->>H: Check if active anchor contains event target
H-->>T: Return true/false
alt Event target is within active anchor
T->>U: Ignore click (tooltip remains unchanged)
else Event target is not within active anchor
T->>U: Open tooltip
end
Sequence Diagram - Close TooltipsequenceDiagram
participant U as User
participant T as Tooltip Component
participant H as activeAnchorContainsTarget
U->>T: Click event (close)
T->>H: Check if active anchor contains event target
H-->>T: Return true/false
alt Event target is within active anchor
T->>U: Ignore click (tooltip remains open)
else Event target is not within active anchor
T->>U: Close tooltip
end
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (3)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Beta version released with the last commit 🚀 or |
Closes #1220
Reproducible here: https://stackblitz.com/edit/stackblitz-starters-ggwyjh
Clicking E2 opens the tooltip, but clicking again does not close it.
Fixed here (with beta version): https://stackblitz.com/edit/stackblitz-starters-9thax4ga
Summary by CodeRabbit