[FIX] point_of_sale: search customers with full search query
When the keypress handler is called the pressed key has not yet been added to this.value. This leads to the search being performed with e.g. 'Agr' when the user has typed 'Agro'. Fix this by getting this value when the timeout expires. At this point the value will be updated. Fixes #21129
This commit is contained in:
@@ -1018,10 +1018,10 @@ var ClientListScreenWidget = ScreenWidget.extend({
|
||||
this.$('.searchbox input').on('keypress',function(event){
|
||||
clearTimeout(search_timeout);
|
||||
|
||||
var query = this.value;
|
||||
var searchbox = this;
|
||||
|
||||
search_timeout = setTimeout(function(){
|
||||
self.perform_search(query,event.which === 13);
|
||||
self.perform_search(searchbox.value, event.which === 13);
|
||||
},70);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user