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

Improve iframe (desktop) search auto-submit timing #964

Merged
merged 3 commits into from Feb 25, 2016

Conversation

Projects
None yet
2 participants
@kabel
Contributor

kabel commented Feb 25, 2016

Slow typing is causing too many queries on the search apps. This new
setup will immediately load/display the search iframe (with a loading
indicator) and only issue a submit after a full second of inactivity on
the keyboard.

Improve iframe (desktop) search auto-submit timing
Slow typing is causing too many queries on the search apps. This new
setup will immediately load/display the search iframe (with a loading
indicator) and only issue a submit after a full second of inactivity on
the keyboard.

@kabel kabel assigned kabel and mfairchild365 and unassigned kabel Feb 25, 2016

var activateSearch = function() {
domSearchForm.parent().addClass('active');
$progress.show();

This comment has been minimized.

@mfairchild365

mfairchild365 Feb 25, 2016

Member

$progress.hide() should now be added to the close() function. If you close the search before it finishes, a loading bar will be stuck on the screen.

@mfairchild365

mfairchild365 Feb 25, 2016

Member

$progress.hide() should now be added to the close() function. If you close the search before it finishes, a loading bar will be stuck on the screen.

This comment has been minimized.

@kabel

kabel Feb 25, 2016

Contributor

Added.

@kabel

kabel Feb 25, 2016

Contributor

Added.

Hide the search frame progress element on search close
This ensures that it doesn't stick around if someone closes the search
frame before it finishes.
autoSubmitTimeout = setTimeout(function() {
domSearchForm.trigger('submit', 'auto');
}, 300);
}, autoSearchDebounceDelay);

This comment has been minimized.

@mfairchild365

mfairchild365 Feb 25, 2016

Member

Should probably check if the search is still open. If it was closed between a keypress and auto-submit, it will pop back open.

@mfairchild365

mfairchild365 Feb 25, 2016

Member

Should probably check if the search is still open. If it was closed between a keypress and auto-submit, it will pop back open.

This comment has been minimized.

@kabel

kabel Feb 25, 2016

Contributor

I believe that is the expectation.The search should come back up when submitted. See line 192.

@kabel

kabel Feb 25, 2016

Contributor

I believe that is the expectation.The search should come back up when submitted. See line 192.

This comment has been minimized.

@mfairchild365

mfairchild365 Feb 25, 2016

Member

I disagree. If a user explicitly closes the search interface (either by clicking away from it or pressing escape) and it closes, it should not open itself.

@mfairchild365

mfairchild365 Feb 25, 2016

Member

I disagree. If a user explicitly closes the search interface (either by clicking away from it or pressing escape) and it closes, it should not open itself.

This comment has been minimized.

@mfairchild365

mfairchild365 Feb 25, 2016

Member

You are correct, that is currently the expectation in the code. However, the longer timeout makes the issue noticeable.

@mfairchild365

mfairchild365 Feb 25, 2016

Member

You are correct, that is currently the expectation in the code. However, the longer timeout makes the issue noticeable.

This comment has been minimized.

@kabel

kabel Feb 25, 2016

Contributor

Or were you thinking that a close event would kill the next auto-submit? That is possible by clearing the timeout in the close function.

@kabel

kabel Feb 25, 2016

Contributor

Or were you thinking that a close event would kill the next auto-submit? That is possible by clearing the timeout in the close function.

This comment has been minimized.

@kabel

kabel Feb 25, 2016

Contributor

Clear added line 138.

@kabel

kabel Feb 25, 2016

Contributor

Clear added line 138.

Cancel the auto-submit search if the search is closed
The user has focused away or escaped, so the search should not be
issued.

mfairchild365 added a commit that referenced this pull request Feb 25, 2016

Merge pull request #964 from unl/search-improvements
Improve iframe (desktop) search auto-submit timing

@mfairchild365 mfairchild365 merged commit 1b23793 into develop Feb 25, 2016

@kabel kabel deleted the search-improvements branch Feb 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment