You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
The button to add a new entity is on the entity picker. This invokes a callback back out to the parent component which contains the editor and it is responsible for creating the new entity, updating its state which then updates the editor with a new available option. The editor naively assumes any new option must have been added due to the button from within itself and assumes whatever text was selected should be labeled as the newly added entity. This is an assumption that's may not be true if new entity is added from outside while the user is interacting with the control.
It would be better if this entity was created and assigned to the selected text in more reliable manner.
Solution?
There might be a better pattern, but one way is to make the new entity prop callback return the new entity that is created. Instead of invoking as fire/forget it will await the creation of the new entity and then assign the selected text to it while still maintain internal execution context.
The text was updated successfully, but these errors were encountered:
mattmazzola
changed the title
Update to latest version of Slate
Make labeling of selected text to new entity more reliable.
Aug 18, 2018
Problem:
The button to add a new entity is on the entity picker. This invokes a callback back out to the parent component which contains the editor and it is responsible for creating the new entity, updating its state which then updates the editor with a new available option. The editor naively assumes any new option must have been added due to the button from within itself and assumes whatever text was selected should be labeled as the newly added entity. This is an assumption that's may not be true if new entity is added from outside while the user is interacting with the control.
It would be better if this entity was created and assigned to the selected text in more reliable manner.
Solution?
There might be a better pattern, but one way is to make the new entity prop callback return the new entity that is created. Instead of invoking as fire/forget it will await the creation of the new entity and then assign the selected text to it while still maintain internal execution context.
The text was updated successfully, but these errors were encountered: