Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit 2a98941

Browse files
committed
Fix entity check
1 parent ddc0488 commit 2a98941

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ const unstickyInlineStyles = (character, editorState) => {
209209
const startOffset = selection.getStartOffset();
210210
const content = editorState.getCurrentContent();
211211
const block = content.getBlockForKey(selection.getStartKey());
212-
const entity = block.getEntityAt(startOffset);
212+
const entity = block.getEntityAt(startOffset - 1);
213213
if (entity !== null) return editorState;
214214

215215
// If we're currently in a style, but the next character doesn't have a style (or doesn't exist)

0 commit comments

Comments
 (0)