diff --git a/extensions/tags/js/src/common/components/TagSelectionModal.tsx b/extensions/tags/js/src/common/components/TagSelectionModal.tsx
index 7b9366f7b8..1f67f788c6 100644
--- a/extensions/tags/js/src/common/components/TagSelectionModal.tsx
+++ b/extensions/tags/js/src/common/components/TagSelectionModal.tsx
@@ -135,6 +135,14 @@ export default class TagSelectionModal<
return this.attrs.title;
}
+ lengthWithCJK(text: string) {
+ let length = 0;
+ for (const char of text) {
+ length += /[\u4E00-\u9FFF\u3400-\u4DBF\uF900-\uFAFF]/.test(char) ? 2 : 1;
+ }
+ return length;
+ }
+
content() {
if (this.loading || !this.tags) {
return