Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enter event #2217

Closed
ayozebarrera opened this issue Dec 14, 2017 · 4 comments · May be fixed by baophucct/codesandboxer#1
Closed

Enter event #2217

ayozebarrera opened this issue Dec 14, 2017 · 4 comments · May be fixed by baophucct/codesandboxer#1

Comments

@ayozebarrera
Copy link

ayozebarrera commented Dec 14, 2017

Hi, good work!

I think the problem comes with #212...

Every input item on a form, if its focused, it will submit the form (if not empty!) if you press enter key... but react-select will open the list... why? I don't see any good reason for that...

Anyway, if this will be the behaviour, how can I solve it?

thanks

@alexxmde-zz
Copy link

Same issue here

@sstern6
Copy link

sstern6 commented Jan 2, 2018

Having the same problem

@thiagolelis-luizalabs
Copy link

You can override the onInputKeyDown function, like this:

    onInputKeyDown(event) {
        switch (event.keyCode) {
            case 13: // ENTER
                event.preventDefault();
                break;
        }
    }

And on Select

<Select
    {...otherProps}
    onInputKeyDown={onInputKeyDown}
/>

@sstern6
Copy link

sstern6 commented Jan 3, 2018

@thiagolelis-luizalabs thanks but wasnt this issue fixed and is supposed to be intended functionality, not supposed to be overwritten?

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

Successfully merging a pull request may close this issue.

4 participants