Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
Support the autocorrect and autocapitalize attributes in the field macro
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhose committed Aug 1, 2022
1 parent 669773a commit 23360bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/templates/src/res/components/field.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
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 %}
Expand All @@ -37,6 +37,8 @@
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 %}
Expand Down

0 comments on commit 23360bc

Please sign in to comment.