From 6dba92702f362e35993c2301e15fe85b6247de7a Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Mon, 27 Feb 2023 13:52:14 +0200 Subject: [PATCH] RED-6217: Removed the 3 character limitation for non-latin strings. --- .../modules/file-preview/file-preview-screen.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts index 5f903121a..981901ba0 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts @@ -157,7 +157,7 @@ export class FilePreviewScreenComponent tap(([selectedText, canPerformActions, file]) => { const isCurrentPageExcluded = file.isPageExcluded(this.pdf.currentPage); - if (selectedText.length > 2 && canPerformActions && !isCurrentPageExcluded) { + if ((selectedText.length > 2 || this._isJapaneseString(selectedText)) && canPerformActions && !isCurrentPageExcluded) { this.pdf.enable(textActions); } else { this.pdf.disable(textActions); @@ -777,4 +777,8 @@ export class FilePreviewScreenComponent const annotations = this._annotationManager.get(selected); this._annotationManager.select(annotations); } + + private _isJapaneseString(text: string) { + return text.match(/[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/); + } }