@@ -247,15 +247,15 @@ impl<M, D, S> ListSelect<M, D, S>
247
247
/// flowing. When a `List` is constructed with this method, all items will have a fixed, equal
248
248
/// length.
249
249
pub fn item_size ( self , length : Scalar ) -> ListSelect < M , D , widget:: list:: Fixed > {
250
- let ListSelect { common, num_items, mode, direction, style, item_instantiation , .. } = self ;
250
+ let ListSelect { common, num_items, mode, direction, style, .. } = self ;
251
251
ListSelect {
252
252
common : common,
253
253
num_items : num_items,
254
254
mode : mode,
255
255
direction : direction,
256
256
item_size : widget:: list:: Fixed { length : length } ,
257
257
style : style,
258
- item_instantiation : item_instantiation ,
258
+ item_instantiation : widget :: list :: ItemInstantiation :: OnlyVisible ,
259
259
}
260
260
}
261
261
}
@@ -315,6 +315,10 @@ impl<M, D> ListSelect<M, D, widget::list::Fixed> {
315
315
/// Indicates that an `Item` should be instatiated for every element in the list, regardless of
316
316
/// whether or not the `Item` would be visible.
317
317
///
318
+ /// This is the default (and only) behaviour for `List`s with dynamic item sizes. This is
319
+ /// because a `List` cannot know the total length of its combined items in advanced when each
320
+ /// item is dynamically sized and their size is not given until they are set.
321
+ ///
318
322
/// Note: This may cause significantly heavier CPU load for lists containing many items (100+).
319
323
/// We only recommend using this when absolutely necessary as large lists may cause unnecessary
320
324
/// bloating within the widget graph, and in turn result in greater traversal times.
@@ -327,7 +331,7 @@ impl<M, D> ListSelect<M, D, widget::list::Fixed> {
327
331
/// avoid bloating the widget graph with unnecessary nodes and in turn keep traversal times to
328
332
/// a minimum.
329
333
///
330
- /// This is the default `List` behaviour .
334
+ /// This is the default behaviour for `ListSelect`s with fixed item sizes .
331
335
pub fn instantiate_only_visible_items ( mut self ) -> Self {
332
336
self . item_instantiation = widget:: list:: ItemInstantiation :: OnlyVisible ;
333
337
self
0 commit comments