instead of directly setting the minvalue when the maxvalue is lower
we invalidate it and only on blur we set the minvalue

without this we lose the minvalue when editing only the maxvalue

e.g.:

Max: 2048
Min: 1024

if we now edit the maxvalue to 4096, on pressing the '4', we are
setting the minvalue to '4' because 4 is lower than 1024

Signed-off-by: Dominik Csapak <[email protected]>
---
 www/manager6/qemu/MemoryEdit.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/www/manager6/qemu/MemoryEdit.js b/www/manager6/qemu/MemoryEdit.js
index 1974abc4..6fda271b 100644
--- a/www/manager6/qemu/MemoryEdit.js
+++ b/www/manager6/qemu/MemoryEdit.js
@@ -101,10 +101,16 @@ Ext.define('PVE.qemu.MemoryInputPanel', {
                    change: function(f, value) {
                        var bf = me.down('field[name=balloon]');
                        var balloon = bf.getValue();
+                       bf.setMaxValue(value);
+                       bf.validate();
+                   },
+                   blur: function(f) {
+                       var value = f.getValue();
+                       var bf = me.down('field[name=balloon]');
+                       var balloon = bf.getValue();
                        if (balloon > value) {
                            bf.setValue(value);
                        }
-                       bf.setMaxValue(value);
                    }
                }
            },
-- 
2.11.0


_______________________________________________
pve-devel mailing list
[email protected]
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to