Project

General

Profile

Actions

Defect #11909

closed

Autocomplete results not reset after clearing search field

Added by Jongwook Choi over 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
UI
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Explain for the defect

There are several autocomplete UI's for searching a specific field in redmine;
for example, searching for user (in a modal dialog when adding issue watchers) and for user or group (in the member tab of project settings).

The search result at first show the list of all possible values (to be added),
and when user types a query to search for user (or group), with a delay of 300ms, the search result list shows up with checkboxes.

However, if the search query becomes an empty string,
no ajax request is fired and therefore the list remains to show values the search result for the preivous query, which seems to be quite unnatural.

Is this behavior intended, or is a bug ? For older versions of redmine (e.g. 1.1.x), the search works as I expected.

I think, when query becomes empty, showing up the list identical to the initial list (when query was empty) would be more natural behavior.
That is, the ajax request should be fired even if the query is empty.

About the implementation

Since 2.1, redmine has adopted jQuery, and the cause lies on the function 'observeSearchfield' in /public/javascripts/application.js.

There is an if clause that checks whether query is empty (see source:/trunk/public/javascripts/application.js#L481).
What if it is removed?

Moreover, as far as I know, recent versions (such as 1.4.x and 2.0.x) are affected as well.
Shortly, I will find out patches for the older versions that has another implementation of field observation.

Thank you very much!


Files

application.js-emptyquery.patch (1.13 KB) application.js-emptyquery.patch Jongwook Choi, 2012-09-22 19:00
searchfield-empty.png (7.28 KB) searchfield-empty.png Jongwook Choi, 2012-09-22 19:00
Actions #1

Updated by Jean-Philippe Lang over 12 years ago

  • Subject changed from Searching field (autocomplete) result doesn't show up when search query is empty to Autocomplete results not reset after clearing search field
  • Target version set to 2.1.1
Actions #2

Updated by Jongwook Choi over 12 years ago

After an inspection, it turns out there is NO problem with redmine 1.4.x and 2.0.x. Affected by turning into jQuery only.
Thanks!

Actions #3

Updated by Jean-Philippe Lang about 12 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Patch committed in r10527 and merged into 2.1-stable, thanks.

Actions

Also available in: Atom PDF