all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH widget-toolkit] Add focusable pseudo class to edit windows defaultFocus
@ 2020-07-08  8:42 Fabian Möller
  2020-07-09 12:12 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Möller @ 2020-07-08  8:42 UTC (permalink / raw)
  To: pve-devel

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




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

end of thread, other threads:[~2020-07-09 12:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08  8:42 [pve-devel] [PATCH widget-toolkit] Add focusable pseudo class to edit windows defaultFocus Fabian Möller
2020-07-09 12:12 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal