Defect #11909
closedAutocomplete results not reset after clearing search field
0%
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
Updated by Jean-Philippe Lang about 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
Updated by Jongwook Choi about 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!
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.