選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

editOnCompositionStart.js 771 B

1234567891011121314151617181920212223242526272829
  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. 'use strict';
  12. var EditorState = require("./EditorState");
  13. /**
  14. * The user has begun using an IME input system. Switching to `composite` mode
  15. * allows handling composition input and disables other edit behavior.
  16. */
  17. function editOnCompositionStart(editor, e) {
  18. editor.setMode('composite');
  19. editor.update(EditorState.set(editor._latestEditorState, {
  20. inCompositionMode: true
  21. })); // Allow composition handler to interpret the compositionstart event
  22. editor._onCompositionStart(e);
  23. }
  24. module.exports = editOnCompositionStart;