Skip to content

Commit

Permalink
list_widget: Fix more elements not rendered on scrolling to bottom.
Browse files Browse the repository at this point in the history
This bug can be reproduced by scrolling anywhere where list widget
is used except recent view.

`$scroll_container` was used before
371cd0d
to listen to scroll events which was incorrectly replaced by
`opts.$simplebar_container` in the above commit. To fix this,
we use the same function `scroll_util.get_scroll_element` to
get the correct scroll element.
  • Loading branch information
amanagr committed Jun 20, 2024
1 parent ee2852e commit e444ff7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/src/list_widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ export function create<Key, Item = Key>(
// We still keep `html` as `$scroll_container` to use
// its various methods as `HTMLElement`.
$scroll_listening_element = $(window);
} else {
// When `$scroll_container` is a specific element, we listen
// for scroll events on that element.
$scroll_listening_element = scroll_util.get_scroll_element(opts.$simplebar_container);
}

const meta: ListWidgetMeta<Key, Item> = {
Expand Down

0 comments on commit e444ff7

Please sign in to comment.