question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add onPressEnter for select component

See original GitHub issue

What problem does this feature solve?

When we use Select with ‘combobox’ mode, we usually do some thing when user press Enter, like do a search action. Hope to support this feature.

What does the proposed API look like?

<Select onPressEnter={this.handlePressEnter}>{options}</Select>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:17 (16 by maintainers)

github_iconTop GitHub Comments

5reactions
afc163commented, Jul 15, 2017

There are two workarounds for now.

  1. AutoComplete with input[onKeyDown]: https://codepen.io/afc163/pen/VWRqVo?editors=001
  2. Select with onKeyDown in wrapper: https://codepen.io/afc163/pen/NgJeep?editors=001 like @yesmeck said.

And we still need to fix Select[combobox][onKeyDown].

1reaction
yesmeckcommented, Dec 8, 2017

I think it’s ok to fire on every keyDown event and in all modes. People who want Enter event just check e.keyCode.

Read more comments on GitHub >

github_iconTop Results From Across the Web

to call onChange event after pressing Enter key - Stack Overflow
According to React Doc, you could listen to keyboard events, like onKeyPress or onKeyUp , not onChange . var Input = React.
Read more >
How to Use the Enter Key Event Handler on a React-Bootstrap ...
React-Bootstrap is a popular library of easy-to-use Bootstrap components for React apps. In this guide, you'll learn about keyboard events ...
Read more >
Input - Ant Design
A basic widget for getting the user input is a text field. Keyboard and mouse can be used for providing or changing data....
Read more >
How to get the enter key in ReactJS ? - GeeksforGeeks
In the input, we have added an on Keypress function which will get activated whenever the user clicks and types something in the...
Read more >
How To Trigger Button Click on Enter - W3Schools
Cancel the default action, if needed event.preventDefault(); // Trigger the button element with a click document.getElementById("myBtn").click(); }
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found