design-system icon indicating copy to clipboard operation
design-system copied to clipboard

Combobox does not call `onLoadMore` callback

Open benderillo opened this issue 1 year ago • 0 comments

Bug report

Required System information

  • NodeJS version: 16
  • Strapi Design System version: 1.2.1
  • Browser: chrome

Describe the bug

The callback onLoadMore is not called.

The Combobox element has two props (hasMoreItems and onLoadMore) that (as I can assume from the names) are meant for paginated loading of combobox options.

However, they don't actually work. I set the hasMoreItems prop to true to get infinite scrolling. And I have initially some options loaded. When I scroll to the bottom of the combobox options list I expect the callback to fire, so I can load more items. But the callback never happens if the number of options in the list is relatively small (e.g. 50 items) and fires only once if the number is large enough (say 100 items page).

Steps to reproduce the behavior

Open this code sandbox and you will find an example that uses Combobox and exhibits this bug. https://codesandbox.io/s/unruffled-swartz-3jz2go?file=/src/combo.jsx

Expected behavior

If hasMoreItems prop is set to true whenever I scroll to the bottom of the combobox options list, the combobox should call the onLoadMore callback.

benderillo avatar Aug 09 '22 08:08 benderillo