Semantic-ui-react: Support onKeyDown in Input

Created on 17 Nov 2016  路  6Comments  路  Source: Semantic-Org/Semantic-UI-React

To be able to allow/disallow different keys in input fields it would be nice if the Input component would have an onKeyDown prop where I could provide my custom event handler. If I call e.preventDefault() in the onKeyDown event handler the onChange handler would not be called.

This might be as easy as to add the onKeyDown into htmlInputPropNames array?

Version

0.60.9

bug

Most helpful comment

Released in [email protected].

All 6 comments

You're correct, I've added #886 to address this. I also tested it in the browser to ensure it works as expected.

Released in [email protected].

The onKeyDown property should be added to the documentation. Great feature!

@levithomason I may be wrong, but it don't seems to be supported anymore.

why was this removed?

@guillemcanal @svey
It's supported, please check: https://codesandbox.io/s/semantic-ui-example-kt84y. It also covered in our docs: https://react.semantic-ui.com/augmentation#unhandled-props-dom-attributes

Was this page helpful?
0 / 5 - 0 ratings