react-typeahead icon indicating copy to clipboard operation
react-typeahead copied to clipboard

Focus on text input when typeahead is clicked

Open rishadjb opened this issue 8 years ago • 5 comments

When I click in the area of the typeahead (or tokenizer when using it), it doesn't focus on the text input field automatically. I have to click the input field to focus on it.

There is a .focus function, but there is no onClick for the typeahead, which I link the .focus to.

Is there way to do this? Hopefully my explanation is clear enough in what I intend to do.

Thanks.

rishadjb avatar Aug 18 '16 14:08 rishadjb

mar-16-2017 10-37-16

I think I am having the same issue like @rishadjb described above.

larrydahooster avatar Mar 16 '17 09:03 larrydahooster

yes i have the same issue, i have to click multiple times

alexmassicott avatar Nov 22 '17 16:11 alexmassicott

was there any fix for this? @alexmassicott @larrydahooster ?

Richard-Thompson avatar Dec 15 '17 07:12 Richard-Thompson

@Richard-Thompson

I fixed it by changing the react-typeahead manually in the index.js,

I added on change to the onChange event, replace the index.js in the lib folder in the node_module

I can give you my whole node_module folder if you need it. What causes the dropdown to trigger is this line in the typeahead index.js this.setState({ isFocused: true, showResults: true });

index.js.zip

alexmassicott avatar Dec 15 '17 17:12 alexmassicott

If someone wants to send a PR with this behavior behind an option (or if this is saner default behavior), I'll pick it up and do an alpha.8 release.

fmoo avatar Dec 15 '17 18:12 fmoo