Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/contact field #243

Merged
merged 2 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/open_inwoner/accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ class InboxForm(forms.ModelForm):
label=_("Contactpersoon"),
queryset=User.objects.none(),
to_field_name="email",
widget=forms.HiddenInput(),
widget=forms.HiddenInput(
attrs={"placeholder": _("Voer de naam in van uw contactpersoon")}
),
)
content = forms.CharField(
label="",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<label class="label">
{% if not no_label %}{{ field.label }}{% endif %}

<input id="{{ field.auto_id }}-autocomplete" name="{{ field.name }}-autocomplete" class="input" type="search" spellcheck=false autocomplete="off" autocapitalize="off">
<input id="{{ field.auto_id }}-autocomplete" name="{{ field.name }}-autocomplete" class="input" type="search" spellcheck=false autocomplete="off" autocapitalize="off" {% include "django/forms/widgets/attrs.html" with widget=field.field.widget %}>

{% if field.help_text %}
<p class="p">{{ field.help_text }}</p>
Expand Down
5 changes: 5 additions & 0 deletions src/open_inwoner/js/components/autocomplete/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ const autocompleteField = (node) => {
autoCompleteJS.input.value = selection
hidden.value = choiceValue
},
focus() {
// show list when focusing
autoCompleteJS.start()
},
},
},
threshold: 0,
})

return autoCompleteJS
Expand Down