Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Reaping draft_segmented_entities_behavior
Browse files Browse the repository at this point in the history
Reviewed By: niveditc

Differential Revision: D17155538

fbshipit-source-id: 7dd234afc51f92d016895be9e15f86cde6eba877
  • Loading branch information
Mohamed Moussa authored and facebook-github-bot committed Sep 16, 2019
1 parent 819f58c commit cd4adaa
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/model/modifier/DraftModifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const ContentStateInlineStyle = require('ContentStateInlineStyle');
const applyEntityToContentState = require('applyEntityToContentState');
const getCharacterRemovalRange = require('getCharacterRemovalRange');
const getContentStateFragment = require('getContentStateFragment');
const gkx = require('gkx');
const Immutable = require('immutable');
const insertFragmentIntoContentState = require('insertFragmentIntoContentState');
const insertTextIntoContentState = require('insertTextIntoContentState');
Expand Down Expand Up @@ -174,24 +173,9 @@ const DraftModifier = {
return removeRangeFromContentState(contentState, adjustedRemovalRange);
}
}
let adjustedRemovalRange = rangeToRemove;
if (gkx('draft_segmented_entities_behavior')) {
// Adjust the selection to properly delete segemented and immutable
// entities
adjustedRemovalRange = getCharacterRemovalRange(
contentState.getEntityMap(),
startBlock,
endBlock,
rangeToRemove,
removalDirection,
);
}

const withoutEntities = removeEntitiesAtEdges(
contentState,
adjustedRemovalRange,
);
return removeRangeFromContentState(withoutEntities, adjustedRemovalRange);
const withoutEntities = removeEntitiesAtEdges(contentState, rangeToRemove);
return removeRangeFromContentState(withoutEntities, rangeToRemove);
},

splitBlock: function(
Expand Down

0 comments on commit cd4adaa

Please sign in to comment.