[pve-devel] [PATCH widget-toolkit 1/1] ComboGrid: avoid needing two clicks after reselecting an item

Dominik Csapak d.csapak at proxmox.com
Fri Jan 27 11:14:35 CET 2023


'picker.hide()' hides the picker, but does not do everything to properly
keep track of the picker state in the combobox class.

This lead to a bug when we reselected an entry, we had to click the
picker again twice to open it again.

Use the 'collapse' method of the combobox instead, which does the
necessary book-keeping.

Signed-off-by: Dominik Csapak <d.csapak at 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 ba3ce40..29c3d26 100644
--- a/src/form/ComboGrid.js
+++ b/src/form/ComboGrid.js
@@ -290,7 +290,7 @@ Ext.define('Proxmox.form.ComboGrid', {
 	if (!me.multiSelect) {
 	    picker.on('itemclick', function(sm, record) {
 		if (picker.getSelection()[0] === record) {
-		    picker.hide();
+		    me.collapse();
 		}
 	    });
 	}
-- 
2.30.2






More information about the pve-devel mailing list