]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
form: combo grid: fix selection after filtering
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 28 Mar 2022 13:53:45 +0000 (15:53 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 29 Mar 2022 15:49:15 +0000 (17:49 +0200)
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>
src/form/ComboGrid.js

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