From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2C7335BC3C for ; Wed, 8 Jul 2020 10:43:51 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 210962E5E5 for ; Wed, 8 Jul 2020 10:43:51 +0200 (CEST) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id DD8632E5DB for ; Wed, 8 Jul 2020 10:43:49 +0200 (CEST) Received: by mail-wr1-x42e.google.com with SMTP id z13so47958170wrw.5 for ; Wed, 08 Jul 2020 01:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AUHUd99rQxGFFmlqve2fYWVF7DPY1WPTLoiG8qwCQpE=; b=Na1wAhfL0fsqX1SWzJJh33Ub18rpFIVL8E9ztzZN6S6BHcnqIVKVp0BKCYTchRDAQH Z2Wf5maRzgouUJ4C/M6BQMbInMSGZyQdvn5+hLOiFi8Q/bBAT7FGHUy9/FV3y+j5Q0MQ C8FneQc8V/5wU+HHozEaM6q+bKqzz5qUnqDXUhNy0+JudCdG1hz+Zl8tkr6OogSjL4/1 7XDMCUFItNj8VB5GjnKSLjGu0iOgZw2MunCdbvB+fSBevfS6p9UEkT04B/Tu0g6Lxb4Q O9pXoMumcFL8EX2VrVa/C2lM3uMuPn56vixPwchZw/YM2HZJYZwmWgLwQfH7FrkC+Gdw Tbdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AUHUd99rQxGFFmlqve2fYWVF7DPY1WPTLoiG8qwCQpE=; b=s7MeQ3rBXI9jkFx++mmjdE7uITqdVn9x+7H6/GFQIpm2cWWch392Gffev8q9iYQSbm fH0ztPNshhzSN7Psq7HHsSNX+5AqSItWqYqWmBFHbh29RLveXGHFwUKJjLlSZ87avndI hE+VBz1tCOeGgrd5bNrk0dqX/qZ2N4hCxDEV1A1XpEZ5liu/VsrTwaqnI+KfaKk+/gWi nhnaPW0m9P/bDDXt63t8R6SG6T0EhvrU53eN0v6Ku7pNm+wL1Nv9LVAUqu0nPkFnQtYb GIP0VbWxnEVFEufPNkMgNMNDY5SpwJ39caEDjb4NWLQ8zS6/sbGlfyjjDc84hDG+uXJr zgYQ== X-Gm-Message-State: AOAM531ZTfF7rKNM4n5Lk1hD+VDakZvYbOzxkrFzhM6VieN3yltfC/qS EV8kxQcQedCsS+UYcVE16kxfEBKcR4eyCw== X-Google-Smtp-Source: ABdhPJyZCrwkPocaQbsIoI1i0RYunlgtNc8qqBXAa8mnDIJk6hBAm13O1JkY8vAbk8G0hwZE6OyTPw== X-Received: by 2002:adf:ec8c:: with SMTP id z12mr54826528wrn.281.1594197823325; Wed, 08 Jul 2020 01:43:43 -0700 (PDT) Received: from juno.nynex.de ([2a00:e60:7000:ffff:25dc:87bf:4fbb:bb78]) by smtp.gmail.com with ESMTPSA id h84sm5490036wme.22.2020.07.08.01.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 01:43:42 -0700 (PDT) From: =?UTF-8?q?Fabian=20M=C3=B6ller?= To: pve-devel@lists.proxmox.com Date: Wed, 8 Jul 2020 10:42:42 +0200 Message-Id: <20200708084242.555-1-fabianm88@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain FREEMAIL_ENVFROM_END_DIGIT 0.25 Envelope-from freemail username ends in digit FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH widget-toolkit] Add focusable pseudo class to edit windows defaultFocus X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 08:43:51 -0000 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