diff --git a/demo/scripts/controlsV2/sidePane/editorOptions/EditorOptionsPlugin.ts b/demo/scripts/controlsV2/sidePane/editorOptions/EditorOptionsPlugin.ts index 6e216f2da1a..1e9085c302b 100644 --- a/demo/scripts/controlsV2/sidePane/editorOptions/EditorOptionsPlugin.ts +++ b/demo/scripts/controlsV2/sidePane/editorOptions/EditorOptionsPlugin.ts @@ -58,7 +58,7 @@ const initialState: OptionState = { handleTabKey: true, }, customReplacements: emojiReplacements, - experimentalFeatures: new Set(['PersistCache']), + experimentalFeatures: new Set(['PersistCache', 'HandleEnterKey']), }; export class EditorOptionsPlugin extends SidePanePluginImpl { diff --git a/demo/scripts/controlsV2/sidePane/editorOptions/ExperimentalFeatures.tsx b/demo/scripts/controlsV2/sidePane/editorOptions/ExperimentalFeatures.tsx index da543da70c9..2bd26858972 100644 --- a/demo/scripts/controlsV2/sidePane/editorOptions/ExperimentalFeatures.tsx +++ b/demo/scripts/controlsV2/sidePane/editorOptions/ExperimentalFeatures.tsx @@ -9,7 +9,13 @@ export interface DefaultFormatProps { export class ExperimentalFeatures extends React.Component { render() { - return this.renderFeature('PersistCache'); + return ( + <> + {this.renderFeature('PersistCache')} + {this.renderFeature('HandleEnterKey')} + {this.renderFeature('LegacyImageSelection')} + + ); } private renderFeature(featureName: ExperimentalFeature): JSX.Element { diff --git a/packages/roosterjs-content-model-plugins/lib/edit/EditPlugin.ts b/packages/roosterjs-content-model-plugins/lib/edit/EditPlugin.ts index 82bf6f54b52..0e3af9c35c3 100644 --- a/packages/roosterjs-content-model-plugins/lib/edit/EditPlugin.ts +++ b/packages/roosterjs-content-model-plugins/lib/edit/EditPlugin.ts @@ -63,7 +63,7 @@ export class EditPlugin implements EditorPlugin { */ initialize(editor: IEditor) { this.editor = editor; - this.handleNormalEnter = this.editor.isExperimentalFeatureEnabled('PersistCache'); + this.handleNormalEnter = this.editor.isExperimentalFeatureEnabled('HandleEnterKey'); if (editor.getEnvironment().isAndroid) { this.disposer = this.editor.attachDomEvent({ diff --git a/packages/roosterjs-content-model-plugins/test/edit/EditPluginTest.ts b/packages/roosterjs-content-model-plugins/test/edit/EditPluginTest.ts index bbe1a0acb9b..6ad3df27402 100644 --- a/packages/roosterjs-content-model-plugins/test/edit/EditPluginTest.ts +++ b/packages/roosterjs-content-model-plugins/test/edit/EditPluginTest.ts @@ -162,7 +162,7 @@ describe('EditPlugin', () => { it('Enter, normal enter enabled', () => { isExperimentalFeatureEnabledSpy.and.callFake( - (featureName: string) => featureName == 'PersistCache' + (featureName: string) => featureName == 'HandleEnterKey' ); plugin = new EditPlugin(); const rawEvent = { which: 13, key: 'Enter' } as any; diff --git a/packages/roosterjs-content-model-types/lib/editor/ExperimentalFeature.ts b/packages/roosterjs-content-model-types/lib/editor/ExperimentalFeature.ts index 15159013fd9..46e58d639df 100644 --- a/packages/roosterjs-content-model-types/lib/editor/ExperimentalFeature.ts +++ b/packages/roosterjs-content-model-types/lib/editor/ExperimentalFeature.ts @@ -12,4 +12,8 @@ export type ExperimentalFeature = /** * Workaround for the Legacy Image Edit */ - | 'LegacyImageSelection'; + | 'LegacyImageSelection' + /** + * Use Content Model handle ENTER key + */ + | 'HandleEnterKey';