Skip to content

Commit

Permalink
fix(templates): field placeholder, tabindex, style
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed May 9, 2024
1 parent dd375a2 commit 8837079
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@
{% endif %}
<input {% if attrs.required %}required{% endif %}
name="{{ attrs.name }}"
{% if attrs.placeholder %}placeholder="{{ attrs.placeholder }}" {% elif attrs.unlabeled %}placeholder="{{ slots.label }}" {% endif %}
class="{% if attrs.errors %}is-invalid{% endif %} form-control rounded-3"
{% if attrs.placeholder %}placeholder="{{ attrs.placeholder }}" {% elif attrs.unlabeled %}placeholder="{% slot label %}{% endslot %}"{% endif %}
class="{% if attrs.errors %}is-invalid{% endif %} form-control rounded-3"
id="{{ attrs.id }}"
{% if attrs.readonly %}readonly{% endif %}
{% if attrs.disabled %}disabled{% endif %}
{% if attrs.tabindex %}tabindex="{{ attrs.tabindex }}"{% endif %}
{% if attrs.style %}style="{{ attrs.style }}"{% endif %}
{% if attrs.autocomplete %}autocomplete="{{ attrs.autocomplete }}"{% endif %}
value="{{ attrs.value|default_if_none:"" }}"
type="{{ attrs.type }}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load allauth %}
{% for bound_field in attrs.form %}
{% element field unlabeled=attrs.unlabeled name=bound_field.name type=bound_field.field.widget.input_type required=bound_field.field.required value=bound_field.value id=bound_field.auto_id errors=bound_field.errors placeholder=bound_field.field.widget.attrs.placeholder autocomplete=bound_field.field.widget.attrs.autocomplete %}
{% element field unlabeled=attrs.unlabeled name=bound_field.name type=bound_field.field.widget.input_type required=bound_field.field.required value=bound_field.value id=bound_field.auto_id errors=bound_field.errors placeholder=bound_field.field.widget.attrs.placeholder tabindex=bound_field.field.widget.attrs.tabindex autocomplete=bound_field.field.widget.attrs.autocomplete style=bound_field.field.widget.attrs.style %}
{% slot label %}
{{ bound_field.label }}
{% endslot %}
Expand Down

0 comments on commit 8837079

Please sign in to comment.