Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

editOnCompositionStart.js.flow 881 B

3 lat temu
12345678910111213141516171819202122232425262728293031
  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. * @flow strict-local
  9. * @emails oncall+draft_js
  10. */
  11. 'use strict';
  12. import type DraftEditor from "./DraftEditor.react";
  13. const 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. function editOnCompositionStart(editor: DraftEditor, e: SyntheticEvent<>): void {
  19. editor.setMode('composite');
  20. editor.update(EditorState.set(editor._latestEditorState, {
  21. inCompositionMode: true
  22. })); // Allow composition handler to interpret the compositionstart event
  23. editor._onCompositionStart(e);
  24. }
  25. module.exports = editOnCompositionStart;