Skip to content

Commit

Permalink
fix(select): lazy loading select (#797)
Browse files Browse the repository at this point in the history
* fix(select): remove wron prop passed into renderOption method

* fix(select): do not increment offset when there are no items fetched

Co-authored-by: Andrew Kvashuk <avkvashuk@alfabank.ru>
  • Loading branch information
Andrey Kvashuk and Andrew Kvashuk committed Aug 13, 2021
1 parent 9aa641a commit 68b5602
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/select/src/presets/useLazyLoading/hook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function useLazyLoading({
return {
...state,
options: [...state.options, ...action.payload.options],
offset: state.offset + 1,
offset: state.offset + (action.payload.options.length ? 1 : 0),
allOptionsLoaded: !action.payload.hasMore,
loading: false,
};
Expand Down

0 comments on commit 68b5602

Please sign in to comment.