Writing Flow: Guard against falsey block container#4941
Conversation
The check seems good in any case. I'm also looking around a bit to figure out what is happening, because with this PR the block fails to get focus (unlike outside columns). Which is already an improvement from an error of course. I see that the UID is correct and it is present in the DOM as a child of the container. Unsure why it fails to select. Is there a delay happening here? |
ellatrix
left a comment
There was a problem hiding this comment.
Good temporary fix, but we'll have to figure out why the block won't focus.
|
The main issue is that the rendering occurs in the reverse order as what is expected: |
This pull request seeks to resolve an application error which can occur when pasting some content into a Columns block.
Implementation notes:
It seems our
WritingFlowbehaviors assumes that all other block rendering has flushed by the timecomponentDidUpdateis called. While I'm yet unclear what it is about nested blocks that breaks this expectation (i.e. error'ing only in Columns), I don't think that we should not be relying on this behavior unless it's explicitly documented somewhere to occur this way (renders occurring upward from children through to ancestors).Testing instructions:
Copy content from the following Google Doc:
https://docs.google.com/document/d/1z4B4WT3KI11AhQS29iKDBNeoqrjmDpFCNYzZLKr_Oy4/edit?usp=sharing
Paste into a column of the Columns block.
Verify that no errors occur.