national-gold•3y ago
useSelect fetch on scroll
it's me again!)
How to use scroll pagination with select via useSelect hook? Maybe you have any example?
29 Replies
equal-aqua•3y ago
Hi, great to see you again
you can follow this example
https://refine.dev/docs/api-reference/antd/hooks/field/useSelect/#infinite-loading-example
you can follow this example
https://refine.dev/docs/api-reference/antd/hooks/field/useSelect/#infinite-loading-examplenational-goldOP•3y ago
i saw it, but in your example it doesn't work(
https://owaiyvrkbgithub-hbbq--3000.local.webcontainer.io/posts/create
it fetches data ones and thats it, but what about scrolling?)
equal-aqua•3y ago
oh sorry, i will debug and inform you
national-goldOP•3y ago
so i use this getList method in data provider

national-goldOP•3y ago
and as i understand from docs, useSelect use em as default method
equal-aqua•3y ago
yes, you are right
i check infinite loading example, in post list page, on table's category filter works as expected.
am i missing something ?
code example is here: pages/posts/list.tsx
national-goldOP•3y ago

national-goldOP•3y ago
this one)
equal-aqua•3y ago
infinite scroll example only implemented on here. category section filter

national-goldOP•3y ago
wow
i try to find it in create)) or edit)
equal-aqua•3y ago
i guess we need to write this to doc, we have 4 page and only table filter has implemented code.
sorry about that.
national-goldOP•3y ago
yep, that would be nice for the next similar questions)
from Refine users)
equal-aqua•3y ago
this is the fetch on scroll related code.
src/pages/posts/list.tsx
yes you are absolutely right, thanks for the feedback ! we will handle it as soon as possible
national-goldOP•3y ago
yep, found this)
equal-aqua•3y ago
actually we have
useSelectInfiniteScroll() feature in our backlog.
when we ship this feature, it will be much easier to use. just like a useSelect !national-goldOP•3y ago
i'll try to implement this
equal-aqua•3y ago
please let me know if anythings go wrong
national-goldOP•3y ago
sounds perfect!
thanks brou, you all do great job 😄
glad to use your framework)
equal-aqua•3y ago
thanks 🙏 we are happy to hear that
national-goldOP•3y ago
another case)
try to find only one option, and after that -> delete this option from selected
and you see that initial state will not setted back
@alicanerdurmaz
equal-aqua•3y ago
sorry @amounguluz i couldn't understand. can you give me more explanation please ?
national-goldOP•3y ago
i'll record you video)
equal-aqua•3y ago
thank you
national-goldOP•3y ago
national-goldOP•3y ago
maybe you have any idea how to refetch data?)
@alicanerdurmaz
equal-aqua•3y ago
i will check as soon as possible
national-goldOP•3y ago
thanks)
equal-aqua•3y ago
oh. you want to searchText should stay. did i understand correctly ?
optimistic-gold•3y ago
I think you can do that by passing a custom filter action in
filterOption prop of Select 🤔
I thought antd is going to have a custom prop for it but no, they left this to the user 😅