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

Precedent input when typing ↑ #13

Closed
wants to merge 7 commits into from
Closed

Precedent input when typing ↑ #13

wants to merge 7 commits into from

Conversation

rchoffardet
Copy link

As suggested here #5 , here is the PR :)

input.addEventListener('keydown', event => {
if (event.keyCode === 38) {
input.value = history.getPrevious();
} else if (event.keyCode === 40) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you avoid else by making using of early returns?

}
}

export default History;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this file end with a newline.

@rchoffardet
Copy link
Author

rchoffardet commented Oct 29, 2017

It should be good now

@rchoffardet
Copy link
Author

rchoffardet commented Oct 29, 2017

I just added a limit to the stored history so they won't have any problems in the future.

@freekmurze
Copy link
Member

Closing this as it's already included in #20

@freekmurze freekmurze closed this Oct 30, 2017
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 this pull request may close these issues.

None yet

2 participants