mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-09 02:44:49 +00:00
Call initialize on the rendered element on AnyView
This commit is contained in:
parent
0aa9c6b61d
commit
66b520a513
1 changed files with 6 additions and 3 deletions
|
@ -316,9 +316,12 @@ impl<V: Render> From<View<V>> for AnyView {
|
|||
initialize: |view, cx| {
|
||||
cx.with_element_id(view.model.entity_id, |_, cx| {
|
||||
let view = view.clone().downcast::<V>().unwrap();
|
||||
Box::new(AnyElement::new(
|
||||
view.update(cx, |view, cx| Render::render(view, cx)),
|
||||
))
|
||||
let element = view.update(cx, |view, cx| {
|
||||
let mut element = AnyElement::new(view.render(cx));
|
||||
element.initialize(view, cx);
|
||||
element
|
||||
});
|
||||
Box::new(element)
|
||||
})
|
||||
},
|
||||
layout: |view, element, cx| {
|
||||
|
|
Loading…
Reference in a new issue