From db6f174a27dca32be7d673a608d2e2c09f9f7e43 Mon Sep 17 00:00:00 2001 From: Jiuqing Song Date: Wed, 4 Sep 2024 12:24:08 -0700 Subject: [PATCH] Fix picker issue, allow + for mentions (#2783) --- .../lib/plugins/Picker/PickerPlugin.ts | 7 +++++-- versions.json | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/roosterjs-editor-plugins/lib/plugins/Picker/PickerPlugin.ts b/packages/roosterjs-editor-plugins/lib/plugins/Picker/PickerPlugin.ts index 52132d6e792..3d6a08f2cc4 100644 --- a/packages/roosterjs-editor-plugins/lib/plugins/Picker/PickerPlugin.ts +++ b/packages/roosterjs-editor-plugins/lib/plugins/Picker/PickerPlugin.ts @@ -41,6 +41,8 @@ const UNIDENTIFIED_KEY = 'Unidentified'; // the char code for Android keyboard events on Webview below 51. const UNIDENTIFIED_CODE = [0, 229]; +const ALLOWED_CHAR_BEFORE_TRIGGER = ['(', '+']; + /** * PickerPlugin represents a plugin of editor which can handle picker related behaviors, including * - Show picker when special trigger key is pressed @@ -347,7 +349,7 @@ export default class PickerPlugin= 0 && wordBeforeCursor[1] == this.pickerOptions.triggerCharacter)) ) { this.setIsSuggesting(true); @@ -565,7 +567,8 @@ export default class PickerPlugin