Skip to content

fix(tooltip): support focus trigger and preserve aria-describedby - #78

Merged
aibayanyu20 merged 1 commit into
nextfrom
sync/rc-component-tooltip-541-542
Aug 31, 2026
Merged

aibayanyu20 merged 1 commit into
nextfrom
sync/rc-component-tooltip-541-542

Conversation

@aibayanyu20

Copy link
Copy Markdown
Member

Summary

  • include focus in the default tooltip triggers
  • preserve an existing child aria-describedby value
  • merge tooltip and child description ids when both exist
  • add regression coverage

Upstream

Verification

  • tooltip tests: 6 passed
  • lint passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b00582fd5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return () => {
const {
trigger = ['hover'],
trigger = ['hover', 'focus'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the tooltip open while either default trigger remains active

With the new default ['hover', 'focus'], a focused target closes when the pointer merely enters and then leaves it, even though focus remains. In packages/trigger/src/index.tsx, onMouseleave and onBlur each independently call triggerOpen(false) without tracking whether the other action is still active, so the mouse-leave event wins and no subsequent focus event reopens the tooltip. The default should not combine these actions until Trigger coordinates their active states, or Trigger should keep the popup open while either hover or focus remains active.

Useful? React with 👍 / 👎.

@aibayanyu20
aibayanyu20 merged commit 870e078 into next Aug 31, 2026
3 checks passed
@aibayanyu20
aibayanyu20 deleted the sync/rc-component-tooltip-541-542 branch November 11, 2026 13:51
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.

1 participant