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

registerInput in Combobox #45

Open
@kennyhk

Description

@kennyhk

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions