1 | /**
|
2 | * Copyright (c) Facebook, Inc. and its affiliates.
|
3 | *
|
4 | * This source code is licensed under the MIT license found in the
|
5 | * LICENSE file in the root directory of this source tree.
|
6 | *
|
7 | * @format
|
8 | *
|
9 | * @emails oncall+draft_js
|
10 | */
|
11 | ;
|
12 |
|
13 | var EditorState = require("./EditorState");
|
14 | /**
|
15 | * The user has begun using an IME input system. Switching to `composite` mode
|
16 | * allows handling composition input and disables other edit behavior.
|
17 | */
|
18 |
|
19 |
|
20 | function editOnCompositionStart(editor, e) {
|
21 | editor.setMode('composite');
|
22 | editor.update(EditorState.set(editor._latestEditorState, {
|
23 | inCompositionMode: true
|
24 | })); // Allow composition handler to interpret the compositionstart event
|
25 |
|
26 | editor._onCompositionStart(e);
|
27 | }
|
28 |
|
29 | module.exports = editOnCompositionStart; |
\ | No newline at end of file |