-
Notifications
You must be signed in to change notification settings - Fork 96
feat: add input test #768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add input test #768
Conversation
commit: |
There was a problem hiding this 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 new features and test coverage to the Input component, addressing issue #697. The changes include new properties for cursor color and extra content, fixes to onChange event handling, improvements to input validation behavior, and comprehensive test cases.
- Adds
cursorColorandextraproperties to the Input component - Fixes onChange context and trigger type issues, adding 'blur' trigger support
- Improves input validation behavior for
allowInputOverMaxand composition input handling - Adds comprehensive test coverage for the Input component
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/input/type.ts | Adds cursorColor and extra property definitions, updates onChange trigger types |
| src/input/input.md | Updates documentation for new properties and onChange trigger types |
| src/input/input.en-US.md | Updates English documentation for new properties and onChange trigger types |
| src/input/defaultProps.ts | Adds default value for cursorColor property |
| src/input/tests/input.test.tsx | Adds comprehensive test suite covering all Input component functionality |
| src/input/Input.tsx | Implements new features, fixes input handling logic, and improves event management |
| src/_util/useDefault.ts | Extends hook to return additional update function for internal state management |
| site/test-coverage.js | Updates test coverage metrics for Input component |
Comments suppressed due to low confidence (1)
src/input/Input.tsx:1
- The maxLength attribute has been removed but the logic that calculates
resultMaxLengthis still present in the component. This creates a disconnect between the UI constraint and the component's internal validation logic, potentially causing inconsistent behavior.
import type { ChangeEvent, CompositionEvent, CSSProperties, FocusEvent, FormEvent, TouchEvent } from 'react';
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
5a4c14a to
00197c4
Compare
00197c4 to
d756721
Compare
|
/update-common |
1 similar comment
|
/update-common |
|
/update-snapshot |
|
⏳ 正在运行快照更新。。。 CI: Open |

🤔 这个 PR 的性质是?
🔗 相关 Issue
TDesignOteam/tdesign-api#697
TDesignOteam/tdesign-api#768
#822
💡 需求背景和解决方案
📝 更新日志
feat(Input): 新增
cursorColor和extra属性fix(Input): 修复
onChange的参数错误、allowInputOverMax无效、clearTrigger='focus'无效,以及中文输入时禁止触发无效等问题本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单