Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

keyCommandInsertNewline.js.flow 662 B

3 anni fa
12345678910111213141516171819202122
  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. const DraftModifier = require("./DraftModifier");
  13. const EditorState = require("./EditorState");
  14. function keyCommandInsertNewline(editorState: EditorState): EditorState {
  15. const contentState = DraftModifier.splitBlock(editorState.getCurrentContent(), editorState.getSelection());
  16. return EditorState.push(editorState, contentState, 'split-block');
  17. }
  18. module.exports = keyCommandInsertNewline;