Draft.js - How to apply custom entity to current selection only?

时间:2018-03-23 00:42:35

标签: reactjs draftjs

I'm using a sample code found here to implement a custom entity for links.

What is the current behavior?

Select a portion of text, and create a link. Then keep typing after the link is created, and the editor will mark all characters you type in as a part of the link.

What is the expected behavior?

The link should be created for the current selection only. When you type more characters after creating a link, they should be plain text, not a link.

1 个答案:

答案 0 :(得分:0)