Created
February 10, 2020 20:25
-
-
Save surajitbasak109/1dd2616b0f51a747e0e7c0c31ccab401 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hanldeKeydown(evt) { | |
const { cursor, searchItems } = this.state; | |
// ... more code ... | |
if (evt.keyCode === 13) { | |
let currentItem = searchItems[cursor]; | |
if (currentItem !== undefined) { | |
const { name, code, rate, unit } = currentItem; | |
this.setState({ item: { name, code, rate, unit }, searchItems: [] }); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment