Skip to content

Conversation

rubbishmaker
Copy link

@rubbishmaker rubbishmaker commented Sep 5, 2025

ant-design/ant-design#54822 对应此需求

Summary by CodeRabbit

  • 新功能

    • SinglePicker 新增 maxTagCount 与 maxTagPlaceholder 属性,支持自定义超出标签占位内容,默认显示 “+ N …”。
  • 体验

    • 占位渲染改为可配置:当未超出时不显示占位;超出时可展示自定义或默认文本,传入被省略的项列表用于渲染。
  • 文档

    • 更新 multiple 示例,演示 maxTagCount 与自定义 maxTagPlaceholder 用法及多选场景。
  • 测试

    • 新增覆盖多场景的用例(未超限、超限、自定义占位、maxTagCount=0、验证 omittedValues)。

Copy link

vercel bot commented Sep 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
picker Ready Ready Preview Comment Sep 5, 2025 7:23am

Copy link

coderabbitai bot commented Sep 5, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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.

Summary of Changes

Hello @rubbishmaker, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

本次拉取请求为多选日期选择器组件引入了新的maxTagPlaceholder属性。此增强功能允许开发者在选中项数量超过maxTagCount限制时,自定义“剩余”或“省略”标签的显示方式。它提供了灵活性,可以渲染自定义React节点,或使用函数根据省略的值动态生成占位符内容,从而改善选中项较多组件的用户体验。

Highlights

  • 新属性引入: 为多选组件引入maxTagPlaceholder属性,允许自定义超出maxTagCount限制时的占位符显示。
  • 灵活性增强: maxTagPlaceholder属性支持传入React节点或一个接收被省略值数组的函数,提供了高度的定制能力。
  • 接口更新: 更新了相关组件接口(BasePickerProps、SingleSelectorProps、MultipleDatesProps)以包含新属性。
  • 默认行为与兼容性: 为maxTagPlaceholder提供了默认实现,确保向后兼容性,并在未指定时提供标准显示。
  • 测试覆盖: 新增了全面的单元测试,验证maxTagPlaceholder在各种场景下的行为,包括边界情况。
  • 文档与示例: 更新了示例文档,展示了maxTagPlaceholder的实际使用方法。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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

这个 PR 很好地实现了多选超出最大数量后自定义 placeholder 的功能。代码结构清晰,并且添加了全面的单元测试,覆盖了多种场景。我发现了一些可以改进的小地方,主要涉及类型定义、React key 的使用和一些冗余代码,这些改动将有助于提升代码质量和可维护性。请查看我的具体评论。

Comment on lines 26 to 34
const maxTagPlaceholder = (value: any[]) => {
return (
<ul>
{value?.map((item) => {
return <li>{item?.format('YYYY-MM-DD')}</li>;
})}
</ul>
);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

maxTagPlaceholder 函数存在两个问题:

  1. value 参数的类型是 any[],这太宽泛了。考虑到这个文件的上下文,它应该被更具体地类型化为 dayjs.Dayjs[]
  2. map 函数中生成的 <li> 元素缺少 key 属性。在 React 中,列表中的每个元素都必须有一个唯一的 key,以避免重新渲染时的性能问题和潜在的 bug。
Suggested change
const maxTagPlaceholder = (value: any[]) => {
return (
<ul>
{value?.map((item) => {
return <li>{item?.format('YYYY-MM-DD')}</li>;
})}
</ul>
);
};
const maxTagPlaceholder = (value: dayjs.Dayjs[]) => {
return (
<ul>
{value?.map((item) => {
const formattedDate = item?.format('YYYY-MM-DD');
return <li key={formattedDate}>{formattedDate}</li>;
})}
</ul>
);
};

Comment on lines 72 to 74
if (!value.length) {
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

if (!value.length) { return null; } 这段检查是多余的。renderRest 函数仅在有省略项时由 rc-overflow 组件调用,这意味着 value(即 rc-overflowdata 属性)不为空,并且其长度大于 maxTagCount。因此,这个检查可以安全地移除。

onInputChange,
multiple,
maxTagCount,
maxTagPlaceholder = (omittedValues: string[]) => `+ ${omittedValues.length} ...`,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

maxTagPlaceholder 默认函数的 omittedValues 参数类型是 string[],但这与属性的定义和用法不匹配。该函数实际接收的是被省略的 DateType 对象数组。为了类型安全和代码清晰,应将其类型更正为 DateType[]

Suggested change
maxTagPlaceholder = (omittedValues: string[]) => `+ ${omittedValues.length} ...`,
maxTagPlaceholder = (omittedValues: DateType[]) => `+ ${omittedValues.length} ...`,

);

// Test maxTagCount = 0
const { container, rerender } = render(
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

render 函数解构出的 rerender 未在测试用例 should handle maxTagCount edge cases1 中被使用。为了提高代码清晰度,应移除这个未使用的变量。另外,测试用例的名称 “edge cases1” 不够具体,可以考虑修改为更具描述性的名称,例如 “should handle maxTagCount=0 edge case”。

Suggested change
const { container, rerender } = render(
const { container } = render(

Copy link

@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: 3

🧹 Nitpick comments (5)
src/PickerInput/SinglePicker.tsx (1)

49-50: 为新公开属性补充注释与约束说明

建议为 maxTagPlaceholder 增加 JSDoc,明确:

  • 仅在 multiple 模式下生效;
  • 当溢出时将接收被省略的 DateType[]
  • maxTagCount="responsive" | number 的配合行为。
   /** Only work when `multiple` is in used */
   maxTagCount?: number | 'responsive';
-  maxTagPlaceholder?: React.ReactNode | ((omittedValues: DateType[]) => React.ReactNode);
+  /**
+   * When selected items exceed `maxTagCount`, render custom placeholder.
+   * Only works in `multiple` mode. Receives omitted values.
+   */
+  maxTagPlaceholder?: React.ReactNode | ((omittedValues: DateType[]) => React.ReactNode);
docs/examples/multiple.tsx (2)

41-56: 示例中复用相同 ref 可能引起困惑

同一个 singleRef 同时赋给多个 SinglePicker,后者会覆盖前者引用;建议仅对需要暴露操作的实例赋 ref,或为每个实例独立创建 ref

-  const singleRef = React.useRef<PickerRef>(null);
+  const singleRef = React.useRef<PickerRef>(null);
+  const weekRef = React.useRef<PickerRef>(null);
...
-  <SinglePicker {...sharedLocale} multiple ref={singleRef} onOpenChange={console.error} />
-  <SinglePicker {...sharedLocale} multiple ref={singleRef} needConfirm />
+  <SinglePicker {...sharedLocale} multiple onOpenChange={console.error} />
+  <SinglePicker {...sharedLocale} multiple ref={singleRef} needConfirm />
...
-  <SinglePicker
+  <SinglePicker
     {...sharedLocale}
     multiple
-    picker="week"
+    picker="week"
+    ref={weekRef}
     defaultValue={[dayjs('2021-01-01'), dayjs('2021-01-08')]}
   />

16-18: 示例中的 console.clear() 可去除

文档示例中清空控制台无必要,影响阅读历史日志。

-console.clear();
tests/multiple.spec.tsx (2)

158-201: 补充“默认占位”用例,覆盖未自定义 maxTagPlaceholder 的场景

当前仅验证自定义占位符;建议再加一例未传入 maxTagPlaceholder 时默认 "+ N ..." 的渲染验证。

   describe('maxTagPlaceholder', () => {
+    it('uses default placeholder when not provided', () => {
+      const { container } = render(
+        <DayPicker
+          multiple
+          maxTagCount={1}
+          defaultValue={[getDay('2000-01-01'), getDay('2000-01-02'), getDay('2000-01-03')]}
+        />,
+      );
+      // 1 个可见条目 + 1 个占位
+      expect(container.querySelectorAll('.rc-picker-selection-item')).toHaveLength(2);
+      // 默认文案形如 "+ 2 ..."
+      expect(container.textContent).toMatch(/\+\s*2\s*\.\.\./);
+    });

224-241: 测试名与变量冗余小修

it('should handle maxTagCount edge cases1' ...) 名称中的 “1” 多余;且 rerender 未使用。可去除或补充二次渲染断言。

-    it('should handle maxTagCount edge cases1', () => {
+    it('should handle maxTagCount edge cases', () => {
@@
-      const { container, rerender } = render(
+      const { container } = render(
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 95da35c and 5edc18a.

📒 Files selected for processing (5)
  • docs/examples/multiple.tsx (1 hunks)
  • src/PickerInput/Selector/SingleSelector/MultipleDates.tsx (3 hunks)
  • src/PickerInput/Selector/SingleSelector/index.tsx (3 hunks)
  • src/PickerInput/SinglePicker.tsx (1 hunks)
  • tests/multiple.spec.tsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
src/PickerInput/Selector/SingleSelector/MultipleDates.tsx (1)
src/PickerInput/SinglePicker.tsx (1)
  • PickerProps (103-105)
src/PickerInput/Selector/SingleSelector/index.tsx (1)
src/PickerInput/SinglePicker.tsx (1)
  • PickerProps (103-105)
docs/examples/multiple.tsx (1)
src/interface.tsx (1)
  • PickerRef (452-456)
tests/multiple.spec.tsx (1)
tests/util/commonUtil.tsx (2)
  • DayPicker (168-173)
  • getDay (186-195)
🪛 Biome (2.1.2)
docs/examples/multiple.tsx

[error] 30-30: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

🔇 Additional comments (4)
src/PickerInput/Selector/SingleSelector/MultipleDates.tsx (2)

7-8: 类型扩展方向正确,接口变更 LGTM

MultipleDatesProps 扩展为同时接收 maxTagCountmaxTagPlaceholder 合理,能与上层 PickerProps 对齐。


28-30: 解构新增 prop 合理,保持向下传递

新增解构 maxTagPlaceholder 并与 maxTagCount 一并传入渲染逻辑,方向正确。

src/PickerInput/Selector/SingleSelector/index.tsx (2)

15-16: Prop 扩展 LGTM

SingleSelectorProps 增加 maxTagPlaceholder 并保持与上层 PickerProps 对齐,方向正确。


168-178: 向下传递 maxTagPlaceholder 的做法正确

默认值在此处统一生效,保证 MultipleDates 始终拿到可用占位符,避免空节点。

Comment on lines 26 to 34
const maxTagPlaceholder = (value: any[]) => {
return (
<ul>
{value?.map((item) => {
return <li>{item?.format('YYYY-MM-DD')}</li>;
})}
</ul>
);
};
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

为可迭代元素添加 key(静态检查已提示)

<li> 添加稳定 key,消除 React/BIOME 警告。

-const maxTagPlaceholder = (value: any[]) => {
+const maxTagPlaceholder = (value: any[]) => {
   return (
     <ul>
-      {value?.map((item) => {
-        return <li>{item?.format('YYYY-MM-DD')}</li>;
+      {value?.map((item, idx) => {
+        return <li key={item?.valueOf?.() ?? idx}>{item?.format('YYYY-MM-DD')}</li>;
       })}
     </ul>
   );
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const maxTagPlaceholder = (value: any[]) => {
return (
<ul>
{value?.map((item) => {
return <li>{item?.format('YYYY-MM-DD')}</li>;
})}
</ul>
);
};
const maxTagPlaceholder = (value: any[]) => {
return (
<ul>
{value?.map((item, idx) => {
return <li key={item?.valueOf?.() ?? idx}>{item?.format('YYYY-MM-DD')}</li>;
})}
</ul>
);
};
🧰 Tools
🪛 Biome (2.1.2)

[error] 30-30: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

🤖 Prompt for AI Agents
In docs/examples/multiple.tsx around lines 26 to 34, the <li> elements inside
the map are missing a stable key causing React/BIOME warnings; update the map to
pass a unique key to each <li> (for example use item.format('YYYY-MM-DD') or
another unique identifier on the item, and fall back to the index only if no
stable id exists) so each list item has a stable key prop.

Comment on lines 72 to 79
if (!value.length) {
return null;
}
const content =
typeof maxTagPlaceholder === 'function'
? maxTagPlaceholder(omittedValues)
: maxTagPlaceholder;
return renderSelector(content);
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

应使用 omittedValues 判空,避免非预期渲染 Rest 占位

这里应判断 omittedValues.length 而不是 value.length,以避免在没有溢出时误渲染占位内容(或与 rc-overflow 的调用时机耦合过深)。

-  function renderRest(omittedValues: DateType[]) {
-    if (!value.length) {
-      return null;
-    }
+  function renderRest(omittedValues: DateType[]) {
+    if (!omittedValues?.length) {
+      return null;
+    }
     const content =
       typeof maxTagPlaceholder === 'function'
         ? maxTagPlaceholder(omittedValues)
-        : maxTagPlaceholder;
+        : (maxTagPlaceholder ?? `+ ${omittedValues.length} ...`);
     return renderSelector(content);
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!value.length) {
return null;
}
const content =
typeof maxTagPlaceholder === 'function'
? maxTagPlaceholder(omittedValues)
: maxTagPlaceholder;
return renderSelector(content);
function renderRest(omittedValues: DateType[]) {
if (!omittedValues?.length) {
return null;
}
const content =
typeof maxTagPlaceholder === 'function'
? maxTagPlaceholder(omittedValues)
: (maxTagPlaceholder ?? `+ ${omittedValues.length} ...`);
return renderSelector(content);
}
🤖 Prompt for AI Agents
In src/PickerInput/Selector/SingleSelector/MultipleDates.tsx around lines 72 to
79, the early-return currently checks value.length which can wrongly suppress or
render the maxTagPlaceholder when there are no omitted items; change the
condition to check omittedValues.length instead so the component returns null
when there are no omitted items to display, and only computes/render the
maxTagPlaceholder when omittedValues.length > 0.

Copy link

@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: 0

♻️ Duplicate comments (3)
src/PickerInput/Selector/SingleSelector/MultipleDates.tsx (1)

72-76: renderRest 增强:空/false 占位应返回 null,且做防御性判空

当用户显式传入 null/false 或(极端情况下)无溢出项时,当前实现会渲染一个空的占位气泡。建议提前返回以避免空节点;同时补充对 omittedValues 的防御性判空,降低对 rc-overflow 调用时机的耦合。

应用以下补丁:

-  function renderRest(omittedValues: DateType[]) {
-    const content =
-      typeof maxTagPlaceholder === 'function'
-        ? maxTagPlaceholder(omittedValues)
-        : maxTagPlaceholder;
-    return renderSelector(content);
-  }
+  function renderRest(omittedValues: DateType[]) {
+    if (!omittedValues?.length) {
+      return null;
+    }
+    const node =
+      typeof maxTagPlaceholder === 'function'
+        ? maxTagPlaceholder(omittedValues)
+        : maxTagPlaceholder;
+    if (node == null || node === false) {
+      return null;
+    }
+    return renderSelector(node);
+  }
src/PickerInput/Selector/SingleSelector/index.tsx (1)

78-78: 默认占位函数类型正确(已从 string[] 修正为 DateType[])

默认实现直观、与 MultipleDates 的使用一致。

tests/multiple.spec.tsx (1)

224-241: 测试命名请更具体并修正编号样式

将 “edge cases1” 更名为能直指场景的名称,便于定位与维护。

-    it('should handle maxTagCount edge cases1', () => {
+    it('should handle maxTagCount=0 edge case', () => {
🧹 Nitpick comments (2)
tests/multiple.spec.tsx (2)

160-162: 收敛 any:测试里为 omittedValues 使用 Dayjs 类型

Dayjs[] 提升类型提示与重构友好度(不影响断言语义)。

+import type { Dayjs } from 'dayjs';
@@
-      const maxTagPlaceholder = (omittedValues: any[]) => (
+      const maxTagPlaceholder = (omittedValues: Dayjs[]) => (
         <span className="custom-max-tag-placeholder">+{omittedValues.length} more</span>
       );
@@
-      const maxTagPlaceholder = (omittedValues: any[]) => (
+      const maxTagPlaceholder = (omittedValues: Dayjs[]) => (
         <span className="custom-max-tag-placeholder">+{omittedValues.length} items</span>
       );
@@
-      const CustomPlaceholder = ({ omittedValues }: { omittedValues: any[] }) => (
+      const CustomPlaceholder = ({ omittedValues }: { omittedValues: Dayjs[] }) => (
         <div className="custom-placeholder-wrapper">
@@
-      const maxTagPlaceholder = (omittedValues: any[]) => (
+      const maxTagPlaceholder = (omittedValues: Dayjs[]) => (
         <span className="edge-case-placeholder">+{omittedValues.length}</span>
       );
@@
-      const maxTagPlaceholder = jest.fn((omittedValues) => (
+      const maxTagPlaceholder = jest.fn((omittedValues: Dayjs[]) => (
         <span className="test-placeholder">+{omittedValues.length}</span>
       ));

Also applies to: 179-181, 203-208, 225-227, 244-246


158-266: 补充一个“未提供自定义占位时”的默认占位渲染用例

验证默认 “+ N ...” 的回退逻辑,防回归。

   describe('maxTagPlaceholder', () => {
@@
     it('should pass correct omittedValues to maxTagPlaceholder', () => {
       const maxTagPlaceholder = jest.fn((omittedValues) => (
         <span className="test-placeholder">+{omittedValues.length}</span>
       ));
@@
       expect(maxTagPlaceholder).toHaveBeenCalledWith([values[2], values[3]]);
     });
+
+    it('should render default "+ N ..." when maxTagPlaceholder is not provided', () => {
+      const { container } = render(
+        <DayPicker
+          multiple
+          maxTagCount={2}
+          defaultValue={[
+            getDay('2000-01-01'),
+            getDay('2000-01-02'),
+            getDay('2000-01-03'),
+            getDay('2000-01-04'),
+          ]}
+        />,
+      );
+      const items = container.querySelectorAll('.rc-picker-selection-item');
+      expect(items).toHaveLength(3);
+      // 最后一个为 Rest 占位
+      expect(items[items.length - 1].textContent).toBe('+ 2 ...');
+    });
   });
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5edc18a and db62167.

📒 Files selected for processing (4)
  • docs/examples/multiple.tsx (1 hunks)
  • src/PickerInput/Selector/SingleSelector/MultipleDates.tsx (3 hunks)
  • src/PickerInput/Selector/SingleSelector/index.tsx (3 hunks)
  • tests/multiple.spec.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/examples/multiple.tsx
🧰 Additional context used
🧬 Code graph analysis (3)
src/PickerInput/Selector/SingleSelector/MultipleDates.tsx (1)
src/PickerInput/SinglePicker.tsx (1)
  • PickerProps (103-105)
tests/multiple.spec.tsx (1)
tests/util/commonUtil.tsx (2)
  • DayPicker (168-173)
  • getDay (186-195)
src/PickerInput/Selector/SingleSelector/index.tsx (1)
src/PickerInput/SinglePicker.tsx (1)
  • PickerProps (103-105)
🔇 Additional comments (5)
src/PickerInput/Selector/SingleSelector/MultipleDates.tsx (2)

7-7: 扩展 props 到 MultipleDatesProps 合理且一致

新增对 maxTagPlaceholder 的透传定义与本次 PR 目标一致。无需改动。


28-29: 从 props 解构 maxTagPlaceholder 正确

命名与上游一致,便于直传到 Overflow 的 renderRest

src/PickerInput/Selector/SingleSelector/index.tsx (2)

174-175: Props 透传无误

maxTagPlaceholder 正确下传至 MultipleDates,行为与预期一致。


15-15: 确认 maxTagPlaceholder 类型一致
PickerProps 中已将 maxTagPlaceholder 声明为 React.ReactNode | ((omittedValues: DateType[]) => React.ReactNode),与 SingleSelector 和 MultipleDates 中的 Pick 用法及默认实现保持一致,无需调整。

tests/multiple.spec.tsx (1)

158-166: 新增 maxTagPlaceholder 用例覆盖面良好

基础场景(未超限不出现占位)验证到位。

@rubbishmaker rubbishmaker changed the title 多选超出最大数后增加自定义dom能力 feat:多选超出最大数后增加maxTagPlaceholder api Sep 7, 2025
@rubbishmaker rubbishmaker changed the title feat:多选超出最大数后增加maxTagPlaceholder api feat:add maxTagPlaceholder api Sep 7, 2025
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