Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Add search on keypress, clear input when value unchanged #1598

Merged
merged 3 commits into from
Nov 5, 2015
Merged

Add search on keypress, clear input when value unchanged #1598

merged 3 commits into from
Nov 5, 2015

Conversation

mbeard
Copy link
Contributor

@mbeard mbeard commented Nov 5, 2015

Added support for search on keypress and fixed issue with clearing out unchanged search value

removed clearing search on consecutive search (double enter) and unit test

replaced double enter with esc key listner

fixes #1244

if (e.which === 13) {
// enter pressed
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice to have:

Also add comments above each number or create a constant so code is easier to read

var ENTER_KEY_CODE = 13;
var TAB_KEY_CODE = 9;
var ESC_KEY_CODE = 27;

instead of the Unchanged part of inputEmptyOrUnchanged add a escape event listener for e.which === 27
https://github.com/ExactTarget/fuelux/pull/1598/files?diff=split#diff-d47536a005af642c7d7777bfa3177960L92

else if (e.which === ESC_KEY_CODE) {
    this.clear();
}

swilliamset added a commit that referenced this pull request Nov 5, 2015
added support for search on keypress and fixed issue with clearing ou…
@swilliamset swilliamset merged commit fc893cf into ExactTarget:master Nov 5, 2015
@interactivellama interactivellama changed the title added support for search on keypress and fixed issue with clearing ou… Add search on keypress, clear input when value unchanged Nov 6, 2015
@interactivellama interactivellama added this to the 3.12.0 milestone Nov 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repeater deletes value of search field at the second ENTER keypress
3 participants