Ticket #5619 (closed bug: fixed)
Autocomplete widget keeps looking for remote data even when it's disabled
| Reported by: | ggp | Owned by: | |
|---|---|---|---|
| Priority: | critical | Milestone: | 1.8.3 |
| Component: | ui.autocomplete | Version: | 1.8.2 |
| Keywords: | autocomplete disable disabled remote | Cc: | |
| Blocking: | Blocked by: |
Description
I think that autocomplete widget shouldn't send Ajax request to server looking for data when the option 'disabled' is true. I don't know if that's a bug or it's thought to work that way, but I think this isn't correct because server receives load even when you're not interested in its response.
If the source of autocomplete is a remote database with a lot of rows to fetch, this is critical. I want to search data only when clicking a 'search' button, and now it's impossible.
Change History
comment:2 Changed 3 years ago by ggp
an easier fix:
$('#my_input').autocomplete({
search: function(event, ui) {
if($(this).autocomplete('option', 'disabled') == true) {
return false;
}
}
});
comment:3 Changed 3 years ago by joern.zaefferer
- Priority changed from major to critical
- Version changed from 1.8.1 to 1.8.2
- Milestone changed from TBD to 1.9
The suggested solution is probably too specific. Autocomplete doesn't care for the disabled option at all, that needs to be fixed.
comment:5 Changed 3 years ago by scott.gonzalez
- Status changed from new to closed
- Resolution set to fixed
Fixed in 90caa93.
comment:7 Changed 3 years ago by Scott González
Autocomplete: Respect the disabled option. Fixes #5619 - Autocomplete widget keeps looking for remote data even when it's disabled.
Changeset: 90caa93a9b4b9b894b055cfb8dae0661ac7788b0


I propose to replace the current _search method with this:
To use it as a fix in current production environments I propose to use this code: