umd/fieldstack.js
/**
 * For a collapsed selection state, remove text based on the specified strategy.
 * If the selection state is not collapsed, remove the entire selected range.
 */
For a collapsed selection state, remove text based on the specified strategy.
If the selection state is not collapsed, remove the entire selected range.
For a collapsed selection state remove text based on the specified strategy . If the selection state is not collapsed remove the entire selected range .
function removeTextWithStrategy(editorState, strategy, direction) {
  var selection = editorState.getSelection();
  var content = editorState.getCurrentContent();
  var target = selection;
  if (selection.isCollapsed()) {
    if (direction === 'forward') {
      if (editorState.isSelectionAtEndOfContent()) {
        return content;
      }
    } else if (editorState.isSelectionAtStartOfContent()) {
      return content;
    }
    target = strategy(editorState);
    if (target === selection) {
      return content;
    }
  }
  return DraftModifier_1.removeRange(content, target, direction);
}
function removeTextWithStrategy ( editorState , strategy , direction ) { var selection = editorState . getSelection ( ) ; var content = editorState . getCurrentContent ( ) ; var target = selection ; if ( selection . isCollapsed ( ) ) { if ( direction === 'forward' ) { if ( editorState . isSelectionAtEndOfContent ( ) ) { return content ; } } else if ( editorState . isSelectionAtStartOfContent ( ) ) { return content ; } target = strategy ( editorState ) ; if ( target === selection ) { return content ; } } return DraftModifier_1 . removeRange ( content , target , direction ) ; }
For a collapsed selection state, remove text based on the specified strategy.
For a collapsed selection state remove text based on the specified strategy .