Skip to content

docs: document align.overflow option including alwaysByViewport#511

Merged
yoyo837 merged 3 commits into
react-component:masterfrom
yoyo837:docs/overflow-alwaysByViewport
May 12, 2026
Merged

docs: document align.overflow option including alwaysByViewport#511
yoyo837 merged 3 commits into
react-component:masterfrom
yoyo837:docs/overflow-alwaysByViewport

Conversation

@yoyo837
Copy link
Copy Markdown
Member

@yoyo837 yoyo837 commented May 12, 2026

Closes #363

Add documentation for the configuration, specifically the option from dom-align.

Changes

  • Updated prop description in Props table to link to dom-align docs
  • Added new section documenting:
      • adjust position in X direction on overflow
      • adjust position in Y direction on overflow
      • always adjust based on viewport instead of scrollable parent
  • Added usage example with

Summary by CodeRabbit

  • 文档
    • 更新 Tooltip 组件 API 文档:将对齐相关内容移至新增“对齐溢出(Align Overflow)”小节,新增对 align.overflow 的说明(包含 adjustX、adjustY、alwaysByViewport 等选项)、使用示例和关于 alwaysByViewport 行为的说明;同时更新 align、showArrow、zIndex、classNames、styles 等属性的描述以提供更清晰的使用指引。

Review Change Stack

Copilot AI review requested due to automatic review settings May 12, 2026 02:52
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

@yoyo837 is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b47519e6-40e5-4997-b832-a9410992a851

📥 Commits

Reviewing files that changed from the base of the PR and between fa51389 and f6b7416.

📒 Files selected for processing (1)
  • README.md
✅ Files skipped from review due to trivial changes (1)
  • README.md

Walkthrough

README 更新了 Tooltip 组件的 align 描述并新增了 Align Overflow 小节,说明 align.overflowadjustXadjustYalwaysByViewport 配置及使用示例。

变更内容

Tooltip 属性文档补充

层级 / 文件 摘要
align.overflow 属性文档
README.md
在 Tooltip Props 表中更新 align 属性的描述,补充 Align Overflow 专节;新增部分定义了 adjustXadjustYalwaysByViewport 字段,说明 tooltip 溢出时的重新定位机制,并附带 JSX 使用示例。

预期审查工作量

🎯 1 (Trivial) | ⏱️ ~3 分钟

建议审查者

  • zombieJ

🐰 我在文档里找到一处光,
溢出、对齐,都写得明亮,
adjustX 与 adjustY 有方,
alwaysByViewport 不再迷茫,
小兔跳跃,为你写下这一行。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR标题准确概括了主要变更:为align.overflow选项(包括alwaysByViewport)添加文档。
Linked Issues check ✅ Passed PR完整满足关联issue #363的要求:文档化了align.overflow配置中的alwaysByViewport选项,包括adjustX、adjustY等相关配置。
Out of Scope Changes check ✅ Passed 所有变更均在scope内,仅涉及README文档更新以文档化align.overflow和alwaysByViewport,无额外的代码或不相关的改动。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 86: 修复 README 中锚点不一致:将标题 `### align.overflow` 统一为可被 Markdown
渲染器识别的稳定锚点形式(例如改为 `### align overflow` 或在标题下添加显式锚点 HTML),并把当前使用的链接
`#align-overflow` 与该标题对齐;在涉及的片段(标题 `### align.overflow` 和引用该片段的链接
`#align-overflow`)中保持一致,确保另外提到的相同问题处(另一个引用处)一并同步修改。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fa7c4b42-09f3-4c32-b423-a7178274ce8e

📥 Commits

Reviewing files that changed from the base of the PR and between 02bfaab and b92a799.

📒 Files selected for processing (1)
  • README.md

Comment thread README.md Outdated
Copy link
Copy Markdown
Contributor

@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 updates the README.md to include detailed documentation for the align.overflow property, including a new configuration table and a usage example. The review feedback correctly identifies that the internal anchor links are broken due to how GitHub processes dots in markdown headers; suggestions were provided to rename the header and update the links to ensure proper navigation.

Comment thread README.md Outdated
Comment thread README.md Outdated
| classNames | classNames?: { root?: string; container?: string;}; | | Semantic DOM class |
| styles | styles?: {root?: React.CSSProperties;container?: React.CSSProperties;}; | | Semantic DOM styles |

### align.overflow
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Consider changing this header to ### Align Overflow. This provides a more readable section title and ensures the anchor #align-overflow (used in the props table) works correctly with GitHub's markdown anchor generation.

Suggested change
### align.overflow
### Align Overflow

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (02bfaab) to head (f6b7416).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #511   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           36        36           
  Branches        14        14           
=========================================
  Hits            36        36           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the README to document the align.overflow configuration (from dom-align), including the previously undocumented alwaysByViewport option, so consumers can correctly configure tooltip overflow behavior.

Changes:

  • Updates the align prop description to reference dom-align and link to a new overflow section.
  • Adds a new align.overflow section documenting adjustX, adjustY, and alwaysByViewport.
  • Adds a JSX usage example demonstrating alwaysByViewport.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
| getTooltipContainer | (triggerNode: HTMLElement) => HTMLElement | () => document.body | get container of tooltip, default to body |
| destroyOnHidden | boolean | false | destroy tooltip when it is hidden |
| align | object | | align config of tooltip. Please ref demo for usage example |
| align | object | | align config of tooltip, ref [dom-align](https://github.com/yiminghe/dom-align). See [align overflow](#align-overflow) below |
yoyo837 and others added 2 commits May 12, 2026 10:56
Change header from '### align.overflow' to '### Align Overflow' so the
generated anchor #align-overflow matches the link in the props table.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@yoyo837 yoyo837 merged commit 4202bd6 into react-component:master May 12, 2026
7 of 8 checks passed
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.

Undocumented alwaysByViewport option

3 participants