Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When you create a link entity, then select it (via mouse or cmd+A) and replace it by typing a new text, first character of the new text is still associated with a link. If you delete a link with a backspace though, everything works as expected, so it only happens for selection without explicit removal.
Select the whole thing (cmd+A), click 'Add a link'
Add a link, hit Confirm
Select your text or highlight everything (cmd+A)
Start typing a new text so that it replaces your link
See the first character of your new text having an old link entity
What is the expected behavior?
First character of the new text should not have an entity
Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?
Affected version of Draft: 0.10.5. All previous versions of Draft do not remove entity on selection at all, entity is being applied to the new text.
Trying in Chrome 70.0.3538.77 (64-bit)
Do you want to request a feature or report a bug? Bug
What is the current behavior? When you create a link entity, then select it (via mouse or cmd+A) and replace it by typing a new text, first character of the new text is still associated with a link. If you delete a link with a backspace though, everything works as expected, so it only happens for selection without explicit removal.
Repro here https://codepen.io/anon/pen/MzyVNy:
What is the expected behavior? First character of the new text should not have an entity
Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js? Affected version of Draft: 0.10.5. All previous versions of Draft do not remove entity on selection at all, entity is being applied to the new text. Trying in Chrome 70.0.3538.77 (64-bit)