yury-dymov / react-autocomplete-input

Autocomplete input field for React
https://yury-dymov.github.io/react-autocomplete-input/
MIT License
199 stars 65 forks source link

onChange and onRequestOptions props do not work together #105

Open rishu605 opened 1 year ago

rishu605 commented 1 year ago

I'm using the component with both onRequestOptions and onChange props. Both of these props work as intended when I pass only one of them. But when I use onChange and onRequestOptions props together, onChange fires but onRequestOptions does NOT fire up.

Not sure what is causing this to happen since it works perfectly when only one of these props is passed.

My use case is that whenever the user enters a "$" sign, I call handleRuleExpressionChange function to do something. And otherwise onRequestOptions should trigger whenever the user enters something that is passed into the trigger prop array

Code below: <TextInput onRequestOptions={() => { console.log("Inside onRequestOptions: ") }} onChange={handleRuleExpressionChange} value={ruleExpression} style={{width: "100%" }} trigger={trig} options={myObj} />

yury-dymov commented 1 year ago

Hi, I am not actively maintaining the library but I am reviewing and merging PRs from time to time.