Reveal item even if project panel was closed while active entry changed
The project panel was actually working just fine, the problem was due to `UniformList` not re-hydrating the element state's scroll offset when being rendered again.
This commit is contained in:
@@ -190,7 +190,15 @@ impl Element for UniformList {
|
|||||||
let shared_scroll_offset = element_state
|
let shared_scroll_offset = element_state
|
||||||
.interactive
|
.interactive
|
||||||
.scroll_offset
|
.scroll_offset
|
||||||
.get_or_insert_with(Rc::default)
|
.get_or_insert_with(|| {
|
||||||
|
if let Some(scroll_handle) = self.scroll_handle.as_ref() {
|
||||||
|
if let Some(scroll_handle) = scroll_handle.0.borrow().as_ref() {
|
||||||
|
return scroll_handle.scroll_offset.clone();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rc::default()
|
||||||
|
})
|
||||||
.clone();
|
.clone();
|
||||||
|
|
||||||
let item_height = self.measure_item(Some(padded_bounds.size.width), cx).height;
|
let item_height = self.measure_item(Some(padded_bounds.size.width), cx).height;
|
||||||
|
|||||||
Reference in New Issue
Block a user