fmoo / react-typeahead

Pure react-based typeahead and typeahead-tokenizer
ISC License
677 stars 232 forks source link

Problem: users must click outside of the form to see suggestions #236

Closed ZakariaHili closed 6 years ago

ZakariaHili commented 7 years ago

Hi

AS you can see below, I used the same code in the tutorial, but when the user type, for example the first time he will see the suggestions, but after choosing a token, he must click outside (onmouseout with click) of the search bar to see propositions, if he didn't, he will not see anything. here the screenshot (here i chosed george then i tried to type PAUL, but nothing showing) image

and if i click outside of the form, and i tried to type again, then i will see the proposals: image

class SearchBar extends React.Component {
    constructor() {
        super();
    }
    componentWillMount() {
        this.setState({ options: ['John', 'Paul', 'George', 'Ringo'] })
    }
    render() {
        return (
            <Row className="show-grid">
                <Col xs={1} md={4}></Col>
                <Col xs={6} md={4} lg={12}>
                    <div class="searchForm">
                        <Tokenizer
                            options={this.state.options}
                            placeholder={this.props.placeholder}
                            />
                        </div>
                </Col>
                <Col xs={1} md={4}></Col>
            </Row>
        );
    }
}

thank you in advance

RALifeCoach commented 6 years ago

Did you get this to work?

ZakariaHili commented 6 years ago

no, i still have the same pb

RALifeCoach commented 6 years ago

I found the bug and fixed it in their code. In order to use the fix, I created a new NPM module called omnigon-react-typeahead. Feel free to use it if you still need that functionality. One day I will get around to creating a PR, but I haven't done that yet.

fmoo commented 6 years ago

One day I will get around to creating a PR

😭😭😭

ZakariaHili commented 6 years ago

@RALifeCoach , I tried your module and its worked perfectly, thank you very much I hope you will create a PR soon