-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AutoComplete doesn't call onUpdateInput when dataSourceConfig is specified #148
Comments
Having this issue as well for the same use case. I created a custom component in my project for now and call onUpdateInput (value) {
const { input, dataSourceConfig, onUpdateInput } = this.props
if (!dataSourceConfig) input.onChange(value)
if (onUpdateInput) onUpdateInput(value)
} Not sure if this is the correct solution but it works. |
@sunnysingh can you provide more of the code to your solution? I'm encountering the same issue. |
@jmtoung I created a gist of my full component here: https://gist.github.com/sunnysingh/0ae0e8fe76b0472d2a8de7df278b27a9 Adjust as needed, hope it helps. |
@sunnysingh Thank you so much Sunny for the quick response. I've been dealing with this frustrating error the entire afternoon. Could you just confirm that you encountered the same issue I'm seeing? Basically what I'm observing is that when I have dataSourceConfig defined, if I type in the text field, I can select one of my options. But after it is selected, I can no longer update the field. Anything I type in the text field is ignored, I can't even delete any text. |
@jmtoung If I remember correctly, it's the same issue I was having. I can't confirm at the moment since I'm using a different autocomplete component, but the one I pasted above should work. Looks like Redux Form still does not proxy the call back to Sorry I can't help beyond that, good luck. Hopefully @erikras or whoever is the current maintainer can add an official fix. |
@sunnysingh Thanks so much for your help! |
@sunnysingh Do you mind creating PR for this ? |
Hi @mihirsoni, I guess this PR could related to this issue, consider merge it please! |
Closing this due to inactivity. please feel free to re-open if issue still persist. |
@mihirsoni this issue still persists :( |
@jmtoung @sunnysingh I'm trying to use this gist https://gist.github.com/sunnysingh/0ae0e8fe76b0472d2a8de7df278b27a9 Can anyone of you provide the link to the usage of it ? I mean the onUpdateInput event still doesn't work for me with redux-form. I’m working on a form use case where I need to fetch the AutoComplete field suggestions (options) from a microservice based on the text entered by the user. I’m using redux-form and redux-form-material-ui for this. However, the events associated with AutoComplete (onUpdateInput, onNewRequest) component are not getting triggered (my intention is to call the microservice on onUpdateInput event and fetch the results). I’m just wondering if someone has already implemented such use case or may be faced similar issue, or any alternative solutions. Links which I’m referring to: Appreciate your help! |
onUpdateInput: value => { if (!dataSourceConfig) { onChange(value) } }
I use the call back to retrieve data from API call which update the datasource array for the AutoComplete
The text was updated successfully, but these errors were encountered: