like-gold
like-gold2y ago

Disable Autocomplete in Inferencers

Hi, I have two issues with the Autocomplete component in relation fields. A. With big resources, the loading time is a no-go. The app is stuck for a good several seconds. B. On the Create component, I have to select ids from the already-available list - which shouldn't be correct, because I'm creating a new resource. For those reasons I wanted to ask (or suggest) if there is an option to disable Autocomplete altogether for custom Inferencers? Thanks.
7 Replies
refine-support-bot
Hi, I am refine support bot :wave:. I am here to help you with your question. I searched for the answer to your question in the refine documentation and found an answer! 🏆
Answer: There is an option to disable Autocomplete altogether for custom Inferencers. SOURCES: ./docs/api-reference/core/components/inferencer.md

Note: If this is the answer you need, then we are very lucky. If not, please wait for someone from the refine core team or the community to try to help you.
cloudy-cyan
cloudy-cyan2y ago
Hey @YechiamTK , Thanks for the feedback. We've some plans to improve Inferencers in the future, but I can't give you a timeline for that.
like-gold
like-gold2y ago
Well actually, not sure that disabling it is the right thing. There are two main problems I'm really facing here: A. Long list for Autocomplete gives bad performance - have you encountered this issue? I have a few thousands records B. On Create Inferencer, the id field shouldn't be changeable (a reasonable RESTful assumption is that the id is generated) Very much understandable, mainly sending feedback 🙂
cloudy-cyan
cloudy-cyan2y ago
A- Sorry but there is no way for now. B- As far as I remember, there is no changeable ID input on the create page, isn't it?
like-gold
like-gold2y ago
B. Perhaps I see it because I'm providing a custom id and not "id" (it's still a relation field), but I do have it changeable
cloudy-cyan
cloudy-cyan2y ago
Since we think that the Inferencer component will be used in development mode, many of the features you want are not available at this stage. But you can get our Inferencer package in your project and make any customizations you want.
like-gold
like-gold2y ago
Yeah I totally understand; this is what I'm doing currently. For A I will consider disabling Autocomplete if the data is larger than a reasonable amount; and for B I simply delete the id (pk) field from the renderer. It's all workarounds for now, most of the questions I open here is probably more for future reference if/when you guys will work on that