form: combo grid: fix selection after filtering

firing 'refresh' in 'clearLocalFilter' was wrong, since that triggers
too often, for example when selecting an entry (since the field lost
focus). This lead to the picker refreshing and not registering the
click and thus not selecting the desired entry.

Instead refresh the view when we really need it: when the picker is shown.
The filter is already gone, but the picker grid does not know this yet,
so we fire the event then.

Fixes: 7e47328 ("Combogrid: clear filter on blur")

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2022-03-28 15:53:45 +02:00 committed by Thomas Lamprecht
parent 04070ce5b1
commit 01a79a9781

View File

@ -300,6 +300,7 @@ Ext.define('Proxmox.form.ComboGrid', {
// //
// we save the minheight to reset it after the load // we save the minheight to reset it after the load
picker.on('show', function() { picker.on('show', function() {
me.store.fireEvent('refresh');
if (me.enableLoadMask) { if (me.enableLoadMask) {
me.savedMinHeight = picker.getMinHeight(); me.savedMinHeight = picker.getMinHeight();
picker.setMinHeight(100); picker.setMinHeight(100);
@ -324,7 +325,6 @@ Ext.define('Proxmox.form.ComboGrid', {
me.store.removeFilter(me.queryFilter, true); me.store.removeFilter(me.queryFilter, true);
me.queryFilter = null; me.queryFilter = null;
me.changingFilters = false; me.changingFilters = false;
me.store.fireEvent('refresh');
} }
}, },