Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

27 строки
793 B

  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
  9. * @emails oncall+draft_js
  10. */
  11. 'use strict';
  12. import type DraftEditor from "./DraftEditor.react";
  13. const invariant = require("fbjs/lib/invariant");
  14. const isHTMLElement = require("./isHTMLElement");
  15. function getContentEditableContainer(editor: DraftEditor): HTMLElement {
  16. const editorNode = editor.editorContainer;
  17. invariant(editorNode, 'Missing editorNode');
  18. invariant(isHTMLElement(editorNode.firstChild), 'editorNode.firstChild is not an HTMLElement');
  19. const htmlElement = (editorNode.firstChild: any);
  20. return htmlElement;
  21. }
  22. module.exports = getContentEditableContainer;