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(components): [input] unify async-validator string length calc #16757

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@
"react",
"react-dom"
]
},
"patchedDependencies": {
"async-validator@4.2.5": "patches/async-validator@4.2.5.patch"
}
},
"lint-staged": {
Expand Down
28 changes: 28 additions & 0 deletions patches/async-validator@4.2.5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/dist-node/index.js b/dist-node/index.js
index 563b966fe2b4dce9583c6d90ceb996215c1104bc..f81c89359f4566b7a1e7b6228227fc858e026670 100644
--- a/dist-node/index.js
+++ b/dist-node/index.js
@@ -564,7 +564,8 @@ var range = function range(rule, value, source, errors, options) {

if (str) {
// 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
- val = value.replace(spRegexp, '_').length;
+ // val = value.replace(spRegexp, '_').length;
+ val = value.length;
}

if (len) {
diff --git a/dist-web/index.js b/dist-web/index.js
index 3bdcb3926b75854c4a9203281400376aa7ea246b..4c4e10a409d007280e6991a0021c6874e9e2a1c3 100644
--- a/dist-web/index.js
+++ b/dist-web/index.js
@@ -560,7 +560,8 @@ var range = function range(rule, value, source, errors, options) {

if (str) {
// 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
btea marked this conversation as resolved.
Show resolved Hide resolved
- val = value.replace(spRegexp, '_').length;
+ // val = value.replace(spRegexp, '_').length;
+ val = value.length;
}

if (len) {
14 changes: 10 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.