viewport_size_observer: Option<SizeObserver>,
viewport_scrollbar_size: Option<f64>,
viewport_scroll_top: usize,
- set_viewport_scroll_top: Option<usize>,
table_ref: NodeRef,
table_size_observer: Option<SizeObserver>,
let separator = separator.emit(pos);
content.add_child(
Container::new()
+ .key(format!("sep-{pos}"))
.class("pwt-list-separator")
.with_child(separator),
);
}
}
- let row = props.renderer.emit(pos);
+ let mut row = props.renderer.emit(pos);
+ row.set_key(format!("row-{pos}"));
content.add_child(row);
}
viewport_scrollbar_size: None,
viewport_ref: NodeRef::default(),
viewport_scroll_top: 0,
- set_viewport_scroll_top: None,
table_ref: NodeRef::default(),
table_size_observer: None,
self.table_size_observer = Some(size_observer);
}
}
- if let Some(top) = self.set_viewport_scroll_top.take() {
- // Note: we delay setting ScrollTop until we rendered the
- // viewport with correct height. Else, set_viewport_scroll_top can
- // fail because the viewport is smaller.
- if let Some(el) = self.viewport_ref.cast::<web_sys::Element>() {
- el.set_scroll_top(top as i32);
- }
- }
}
}