Open
Description
Hi,
What I want to do is pretty simple and I thought it would be supported but I can't find such an option so far.
I have an input text on which I'd like to provide autocomplete. But I don't want to trigger requests unless the text size is > 2.
I've tried the following:
const ConnectedCompanyField = connect(({ value }) => {
if (value.length > 2) {
return {
fieldValuesFetch: {
comparison: value,
value: () => searchField(value, ProviderLabel),
},
};
}
})(CompanyField);
Even if the fieldValuesFetch
is not returned when text is small, the former fieldValuesFetch
remains injected into the component. It looks like a bug to me, but maybe it's intended?
I think it would be easier to provide an ability to "skip" / "ignore" a fetch conditionnally.
Apollo provides an API similar to this:
const ConnectedCompanyField = connect(({ value }) => {
fieldValuesFetch: {
comparison: value,
value: () => searchField(value, ProviderLabel),
skip: value.length <= 2,
},
})(CompanyField);
Metadata
Metadata
Assignees
Labels
No labels