Skip to content
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

Closed
pnamepally opened this issue May 18, 2017 · 11 comments
Closed

Comments

@pnamepally
Copy link

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

@sunnysingh
Copy link

Having this issue as well for the same use case. I created a custom component in my project for now and call onUpdateInput manually:

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.

@jmtoung
Copy link

jmtoung commented Sep 24, 2017

@sunnysingh can you provide more of the code to your solution? I'm encountering the same issue.

@sunnysingh
Copy link

@jmtoung I created a gist of my full component here: https://gist.github.com/sunnysingh/0ae0e8fe76b0472d2a8de7df278b27a9

Adjust as needed, hope it helps.

@jmtoung
Copy link

jmtoung commented Sep 25, 2017

@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.

@sunnysingh
Copy link

sunnysingh commented Sep 25, 2017

@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 onUpdateInput, thus needing to implement it yourself with your own component.

Sorry I can't help beyond that, good luck. Hopefully @erikras or whoever is the current maintainer can add an official fix.

@jmtoung
Copy link

jmtoung commented Sep 25, 2017

@sunnysingh Thanks so much for your help!

@mihirsoni
Copy link
Collaborator

@sunnysingh Do you mind creating PR for this ?

@18601673727
Copy link

Hi @mihirsoni, I guess this PR could related to this issue, consider merge it please!

@mihirsoni
Copy link
Collaborator

Closing this due to inactivity. please feel free to re-open if issue still persist.

@trinadhmoganti
Copy link

@mihirsoni this issue still persists :(

@trinadhmoganti
Copy link

trinadhmoganti commented Dec 20, 2018

@sunnysingh Thanks so much for your help!

@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:
https://v0.material-ui.com/v0.20.0/#/components/auto-complete
https://redux-form.com/7.4.0/examples/material-ui/
https://github.com/erikras/redux-form-material-ui

Appreciate your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants