Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

registerInput in Combobox #45

Open
kennyhk opened this issue Oct 6, 2016 · 0 comments
Open

registerInput in Combobox #45

kennyhk opened this issue Oct 6, 2016 · 0 comments

Comments

@kennyhk
Copy link

kennyhk commented Oct 6, 2016

i need to assign property "ref" as my like, because i need to control the focus/blur behavior manually.

The problem is, i don't know how the "registerInput" work in Combobox, registerInput alway return undefined in following codes :

        let props = {
            options: options,
            onChange: this.onChange,
            onSelect: this.onSelect,
            autocomplete: true,
            autosize: true
            registerInput: ()=> {
                return <input type="search" ref="keyword" value={this.state.value} />;
            }
        };

        return <Combobox {...props} >
        {
            (inputProps, otherProps, registerInput) => {
                inputProps.type = "search";
                inputProps.ref = (c) => {
                    let ref = registerInput(ReactDOM.findDOMNode(c));
                    console.log(ref);   // <- alway undefined
                    return ref;
                };
                return <input {...inputProps}/>;
            }
        }
        </Combobox>;

can you let me know what is my mistake please?

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

No branches or pull requests

1 participant