Skip to content

fix(FeedbackButtons): wrap each button in its own PopoverTrigger [Trivial]#52

Merged
MrOrz merged 1 commit into
masterfrom
fix-popover-trigger-error
May 10, 2026
Merged

fix(FeedbackButtons): wrap each button in its own PopoverTrigger [Trivial]#52
MrOrz merged 1 commit into
masterfrom
fix-popover-trigger-error

Conversation

@MrOrz
Copy link
Copy Markdown
Member

@MrOrz MrOrz commented May 9, 2026

Summary

  • Replaces a single PopoverTrigger wrapping a <div> with individual PopoverTrigger per button
  • Fixes a Base UI console warning: trigger expected a native <button> but received a <div> via the render prop
  • Removes now-unnecessary e.stopPropagation() call

Test plan

  • Thumb up / thumb down buttons still open the feedback popover
  • Re-clicking the same button closes the popover and clears the selection
  • No Base UI warning in browser console

Before

(Only exists on localhost)
圖片

After

voting.mp4

🤖 Generated with Claude Code

Eliminates Base UI warning about non-<button> render in PopoverTrigger
by replacing the shared <div> trigger wrapper with individual triggers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@MrOrz MrOrz changed the title fix(FeedbackButtons): wrap each button in its own PopoverTrigger fix(FeedbackButtons): wrap each button in its own PopoverTrigger [Trivial] May 9, 2026
@MrOrz MrOrz self-assigned this May 9, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the FeedbackButtons component by moving the PopoverTrigger to wrap individual buttons and removing event propagation. The review identifies a bug where the popover closes prematurely when switching between feedback types due to the missing event handling, suggesting the use of e.preventDefault(). Furthermore, the use of multiple PopoverTrigger components within a single Popover is noted as a non-standard pattern that could lead to accessibility and focus management issues.

Comment thread src/components/FeedbackButtons.tsx
Comment thread src/components/FeedbackButtons.tsx
@MrOrz MrOrz merged commit 343111b into master May 10, 2026
10 checks passed
@MrOrz MrOrz deleted the fix-popover-trigger-error branch May 10, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants