From 272b63d32e46e558e837772ecc4911b4a55b4d65 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 15 Dec 2022 13:18:16 -0700 Subject: [PATCH] Explicitly define autofocus as reflected so it works in Firefox too --- api/js/etemplate/Et2InputWidget/Et2InputWidget.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts index 8db96c2e7f..fbd8630ec7 100644 --- a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts +++ b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts @@ -104,6 +104,15 @@ const Et2InputWidgetMixin = >(superclass : T) onchange: { type: Function }, + /** + * Have browser focus this input on load. + * Overrides etemplate2.focusOnFirstInput(), use only once per page + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes + */ + autofocus: { + type: Boolean, + reflect: true + } }; }