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
Removing the last block, or starting with no blocks, leaves the selection in a broken state once blocks are added. I was able to reproduce this with several test cases, this one tests insterting a block into an empty document:
/** @jsx h */importhfrom'../../../helpers/h'exportdefaultfunction(change){change.replaceNodeByKey('a',{object: 'block',type: 'quote'})}exportconstinput=(<value><document><paragraphkey="a">one</paragraph></document></value>)exportconstoutput=(<value><document><quote/></document></value>)
I think this is causing or at least related to a few issues opened since 0.42 namely: #2289, #2279
What's the expected behavior?
I think what should happen is that the selection should be restored to the beginning of the first block when one is inserted. Though this still leaves the editor in a strange state if someone removes a node and tries to do something in the middle.
Anyone got any ideas on how this should behave?
The text was updated successfully, but these errors were encountered:
I'm not really sure about a good solution here. It might be things to fix at the source in the specific places it's causing issues, not assuming that a selection is "set".
One "solution" would be to use unset selections more often, whenever something is blurred, so that people don't assume the selection will always be set?
Do you want to request a feature or report a bug?
bug
What's the current behavior?
Removing the last block, or starting with no blocks, leaves the selection in a broken state once blocks are added. I was able to reproduce this with several test cases, this one tests insterting a block into an empty document:
With the resulting output:
https://gist.github.com/ericedem/21bd5aa094268b89b5e7d79bfc1b7ab8
I think this is causing or at least related to a few issues opened since 0.42 namely: #2289, #2279
What's the expected behavior?
I think what should happen is that the selection should be restored to the beginning of the first block when one is inserted. Though this still leaves the editor in a strange state if someone removes a node and tries to do something in the middle.
Anyone got any ideas on how this should behave?
The text was updated successfully, but these errors were encountered: