[pbs-devel] [PATCH proxmox-backup] ui: autofocus after rendering text fields for 2fa

Oguz Bektas o.bektas at proxmox.com
Thu Feb 4 15:39:30 CET 2021


also fix a small typo

Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
 www/LoginView.js | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/www/LoginView.js b/www/LoginView.js
index 15373533..5e8b2f93 100644
--- a/www/LoginView.js
+++ b/www/LoginView.js
@@ -525,6 +525,11 @@ Ext.define('PBS.login.TfaWindow', {
 			allowBlank: false,
 			regex: /^[0-9]{6}$/,
 			regexText: 'TOTP codes consist of six decimal digits',
+			listeners: {
+			    afterrender: function(field) {
+				field.focus();
+			    },
+			},
 		    },
 		],
 	    },
@@ -551,7 +556,12 @@ Ext.define('PBS.login.TfaWindow', {
 			reference: 'recoveryKey',
 			allowBlank: false,
 			regex: /^[0-9a-f]{4}(-[0-9a-f]{4}){3}$/,
-			regexText: 'Does not looks like a valid recovery key',
+			regexText: 'Does not look like a valid recovery key',
+			listeners: {
+			    afterrender: function(field) {
+				field.focus();
+			    },
+			},
 		    },
 		    {
 			xtype: 'box',
-- 
2.20.1





More information about the pbs-devel mailing list