-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[Bug] Cannot extend MUTABLE entity range in v0.10.5, works in v0.10.4 #1642
Comments
Hey @alexlatchford, I think this is the following (intentional) change from the 0.10.5 changelog:
You can see the reasoning for this change over at #430 and #510. |
Great thanks @thibaudcolas, that indeed looks like the issue. Trying to track down what actually swayed the decision as #430 & #510 seem like they weren't the tipping point. Looks like the author potentially works internal to Facebook, cannot seem to find the PR for that particular change. Anyone from the core team care to weigh in? My use case for extending the mutable entity range is for a mention/tag autocomplete. So the user types |
I think that extending the entity automatically is bad. You should be able to do it yourself in handleBeforeInput. If it automatically extends how would a user break out of that? If doing the extension manually you can decide when to allow the user to break out of the entity (maybe a space or something would cause it). Also the behavior before v0.10.5 was a bit inconsistent because typing at the beginning did not add to the entity. |
True that makes sense, I just tried the underlying problem with links and the behaviour in v0.10.5+ is definitely preferred! Thanks for the tip about |
What is the current behavior?
In v0.10.5 if you place the cursor at the end of a MUTABLE entity and type it does not expand the entity range. If you type in the middle it does.
Check the behaviour of the "Batman" entity in the entity example: https://github.com/facebook/draft-js/blob/master/examples/draft-0-10-0/entity/entity.html
What is the expected behavior?
In v0.10.4 if you type at the end or the middle of the entity range it expands the entity range. This is the desired behaviour I'm looking for.
Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?
Broken in > v0.10.5 and in current master. Works fine in v0.10.4 and below I think.
I've had a quick look through the commit range for v0.10.4...v0.10.5 but nothing immediately jumps out at me.
Not pressing I've just reverted to v0.10.4 for the meantime.
The text was updated successfully, but these errors were encountered: