From 23360bc233e3b419362ae750785d43d7f3d068b8 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 1 Aug 2022 19:51:52 +0200 Subject: [PATCH] Support the autocorrect and autocapitalize attributes in the field macro --- crates/templates/src/res/components/field.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/templates/src/res/components/field.html b/crates/templates/src/res/components/field.html index 6298256f..e840715c 100644 --- a/crates/templates/src/res/components/field.html +++ b/crates/templates/src/res/components/field.html @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. #} -{% macro input(label, name, type="text", form_state=false, autocomplete=false, class="", inputmode="text") %} +{% macro input(label, name, type="text", form_state=false, autocomplete=false, class="", inputmode="text", autocorrect=false, autocapitalize=false) %} {% if not form_state %} {% set form_state = dict(errors=[], fields=dict()) %} {% endif %} @@ -37,6 +37,8 @@ limitations under the License. inputmode="{{ inputmode }}" {% if autocomplete %} autocomplete="{{ autocomplete }}" {% endif %} {% if state.value %} value="{{ state.value }}" {% endif %} + {% if autocorrect %} autocorrect="{{ autocorrect }}" {% endif %} + {% if autocapitalize %} autocapitalize="{{ autocapitalize }}" {% endif %} /> {% if state.errors is not empty %}