Restricting the defaultFocus of the edit windows to only focusable fields
ensures that windows like "PVE -> Virtual Machine -> Manage HA", which
has a first field of xtype "displayfield", receive focus upon opening.
This allows those windows to be closed with the ESC key, which only
works when an element inside has focus.
In newer versions of ExtJS (>= 6.2.0) this filter could be reduced to
"field:canfocus" or maybe even ":canfocus".
---
src/window/Edit.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/window/Edit.js b/src/window/Edit.js
index c165141..d7972b6 100644
--- a/src/window/Edit.js
+++ b/src/window/Edit.js
@@ -33,7 +33,7 @@ Ext.define('Proxmox.window.Edit', {
defaultButton: 'submitbutton',
// finds the first form field
- defaultFocus: 'field[disabled=false][hidden=false]',
+ defaultFocus: 'field:focusable[disabled=false][hidden=false]',
showProgress: false,
--
2.27.0
_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel