Fix panic when painting blocks

Antonio Scandurra created

Change summary

crates/editor2/src/element.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Detailed changes

crates/editor2/src/element.rs 🔗

@@ -2464,7 +2464,9 @@ impl Element<Editor> for EditorElement {
                         self.paint_text(text_bounds, &mut layout, editor, cx);
 
                         if !layout.blocks.is_empty() {
-                            self.paint_blocks(bounds, &mut layout, editor, cx);
+                            cx.with_element_id(Some("editor_blocks"), |cx| {
+                                self.paint_blocks(bounds, &mut layout, editor, cx);
+                            })
                         }
                     });
                 });