Skip to content

Conversation

@RylanBot
Copy link
Collaborator

@RylanBot RylanBot commented Dec 8, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

  • feat(Textarea): 支持 count API,用于自定义计数元素的渲染

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@RylanBot RylanBot force-pushed the rylan/feat/textarea/count branch from 33c283f to 07914dd Compare December 8, 2025 13:59
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 8, 2025

commit: 4bd1c04

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

完成

Copy link
Contributor

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 adds a new count API to the Textarea component, allowing developers to customize how the character counter is rendered.

Key Changes:

  • Added count prop that accepts boolean or a custom render function with context parameters (value, count, maxLength, maxCharacter)
  • Updated example to demonstrate custom count rendering with styled elements
  • Modified internal logic to conditionally show/hide and render count based on the new count prop

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/components/textarea/type.ts Added count prop type definition to support boolean or custom render function
packages/components/textarea/textarea.md Updated Chinese documentation to include the new count API
packages/components/textarea/textarea.en-US.md Updated English documentation with the new count prop description
packages/components/textarea/_example/maxlength.tsx Added example demonstrating custom count rendering with inline styles
packages/components/textarea/Textarea.tsx Implemented count logic with conditional rendering based on prop value
test/snap/snapshots/ssr.test.jsx.snap Updated SSR snapshot to reflect custom count rendering in example
test/snap/snapshots/csr.test.jsx.snap Updated CSR snapshot to reflect custom count rendering in example

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

@RylanBot RylanBot closed this Dec 9, 2025
@RylanBot RylanBot reopened this Dec 9, 2025
@RylanBot RylanBot force-pushed the rylan/feat/textarea/count branch from 088e080 to 4bd1c04 Compare December 10, 2025 07:14
@uyarn uyarn merged commit bd961d9 into develop Dec 10, 2025
9 checks passed
@uyarn uyarn deleted the rylan/feat/textarea/count branch December 10, 2025 11:19
@github-actions github-actions bot mentioned this pull request Dec 15, 2025
16 tasks
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.

4 participants