public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH widget-toolkit] form: combo grid: fix selection after filtering
@ 2022-03-28 13:53 Dominik Csapak
  2022-03-29 15:52 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2022-03-28 13:53 UTC (permalink / raw)
  To: pve-devel

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/form/ComboGrid.js b/src/form/ComboGrid.js
index 3ee0238..4cb79d0 100644
--- a/src/form/ComboGrid.js
+++ b/src/form/ComboGrid.js
@@ -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');
 	}
     },
 
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-29 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 13:53 [pve-devel] [PATCH widget-toolkit] form: combo grid: fix selection after filtering Dominik Csapak
2022-03-29 15:52 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal