Skip to content

Commit

Permalink
fix: 修复邮箱格式校验失败
Browse files Browse the repository at this point in the history
  • Loading branch information
F-jianchao committed Feb 26, 2025
1 parent 346a391 commit 8c520ae
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions packages/amis-editor/src/plugin/Form/InputText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,25 +293,7 @@ export class TextControlPlugin extends BasePlugin {
model: any,
form: any
) => {
const {
showCounter,
validations,
validationErrors = {},
autoComplete
} = form.data;

const is_old_email = oldValue === 'input-email';
const is_old_url = oldValue === 'input-url';

if (is_old_email) {
validations && delete validations.isEmail;
validationErrors && delete validationErrors.isEmail;
}

if (is_old_url) {
validations && delete validations.isUrl;
validationErrors && delete validationErrors.isUrl;
}
const {showCounter, autoComplete} = form.data;

form.setValues({
type: value,
Expand All @@ -322,8 +304,6 @@ export class TextControlPlugin extends BasePlugin {
? autoComplete
: undefined
});
form.changeValue('validations', {...validations});
form.changeValue('validationErrors', {...validationErrors});
}
}),
getSchemaTpl('tplFormulaControl', {
Expand Down

0 comments on commit 8c520ae

Please sign in to comment.