Skip to content
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

Fix form Reset & Form TextArea Style #286

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

Evergcj
Copy link
Collaborator

@Evergcj Evergcj commented Sep 18, 2024

No description provided.

@@ -78,14 +92,30 @@ class FormItemInner extends PureComponent<IFormItemInnerProps, IFormItemInnerSta
return this._touched;
};

validateField = (): Promise<IFieldError> => {
getAllRuleValidateTriggers = (): string[] => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个方法还有用吗

import { IRules, ValidatorError } from '@arco-design/mobile-utils';

import { IRules, ValidatorError, isArray, isObject } from '@arco-design/mobile-utils';
import cloneDeepWith from 'lodash/cloneDeepWith';
Copy link
Collaborator

Choose a reason for hiding this comment

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

lodash没加到package.json里?

break;
default:
const originTrigger = children.props[trigger];
if (triggerPropsField) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个属性好像没有哪里可以传入耶🤔

@adaex adaex added the WIP Work In Progress - This issue or pull request is currently being worked on and is not yet ready for label Oct 21, 2024
@adaex adaex requested a review from Copilot November 20, 2024 03:22
Copy link

@Copilot 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.

Copilot reviewed 6 out of 12 changed files in this pull request and generated 1 suggestion.

Files not reviewed (6)
  • packages/arcodesign/components/form/demo/style/mobile.less: Language not supported
  • packages/arcodesign/components/form/style/index.less: Language not supported
  • packages/arcodesign/components/input/test/snapshots/index.spec.js.snap: Language not supported
  • packages/common-widgets/package-lock.json: Language not supported
  • packages/arcodesign/components/form/type.ts: Evaluated as low risk
  • packages/arcodesign/components/input/index.tsx: Evaluated as low risk
Comments skipped due to low confidence (2)

packages/arcodesign/components/form/demo/custom-item.md:37

  • [nitpick] The key 'names' should be singular to match the convention used in other parts of the code. Consider renaming it to 'name'.
names: [{

packages/arcodesign/components/form/demo/custom-item.md:126

  • [nitpick] The placeholder text 'Please input age' should be 'Please input your age' for better clarity.
<Input placeholder="Please input age"  clearable border="none" onInput={handleInput}/>

>
<Form.Item field="name" label="UserName" trigger="onBlur" rules={rules.name} required>
<Input placeholder="Please input username" clearable border="none" />
</Form.Item>
<Form.Item field="age" label="Age" trigger="onInput" rules={[{type: 'number', min: 12, validateLevel: 'warning'}]}>
<Input placeholder="Please input age" clearable border="none" onInput={handleInput}/>
<Form.Item field="age" label="Age" trigger="onInput" rules={[{type: 'number', min: 12, validateLevel: 'warning'}]} initialValue={11}>
Copy link
Preview

Copilot AI Nov 20, 2024

Choose a reason for hiding this comment

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

The initial value for the 'Age' field is set to 11, which violates the validation rule that specifies a minimum value of 12. Change the initial value to 12 or higher.

Suggested change
<Form.Item field="age" label="Age" trigger="onInput" rules={[{type: 'number', min: 12, validateLevel: 'warning'}]} initialValue={11}>
<Form.Item field="age" label="Age" trigger="onInput" rules={[{type: 'number', min: 12, validateLevel: 'warning'}]} initialValue={12}>

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work In Progress - This issue or pull request is currently being worked on and is not yet ready for
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants