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

Add name field to TextInput #186

Merged
merged 1 commit into from
Sep 18, 2023
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
1 change: 1 addition & 0 deletions src/components/pages/membership_form/DateOfBirth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<div class="field">
<TextInput
input-id="birthDate"
name="birthDate"
:placeholder="$t( 'membership_form_birth_date_placeholder' )"
v-model="formData.date.value"
@blur="$emit('field-changed', 'date')"
Expand Down
1 change: 1 addition & 0 deletions src/components/shared/EmailAddress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TextInput
type="text"
input-id="email"
name="email"
:placeholder="$t( 'form_for_example', { example: $t( 'donation_form_email_placeholder_vuei18n_v3' ) } )"
autocomplete="email"
v-model="formData.email.value"
Expand Down
3 changes: 3 additions & 0 deletions src/components/shared/Name.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<div class="field">
<TextInput
class="is-medium"
name="firstName"
input-id="first-name"
v-model="formData.firstName.value"
:has-error="showError.firstName"
Expand All @@ -56,6 +57,7 @@
<div class="field">
<TextInput
input-id="last-name"
name="lastName"
v-model="formData.lastName.value"
:has-error="showError.lastName"
:placeholder="$t( 'form_for_example', { example: $t( 'donation_form_lastname_placeholder' ) } )"
Expand All @@ -76,6 +78,7 @@
<div class="field">
<TextInput
input-id="company-name"
name="companyName"
:placeholder="$t( 'form_for_example', { example: $t( 'donation_form_companyname_placeholder' ) } )"
autocomplete="organization"
v-model="formData.companyName.value"
Expand Down
2 changes: 2 additions & 0 deletions src/components/shared/Postal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<div class="field">
<TextInput
input-id="street"
name="street"
:placeholder="$t( 'form_for_example', { example: $t( 'donation_form_street_placeholder' ) } )"
autocomplete="street-address"
v-model="formData.street.value"
Expand All @@ -26,6 +27,7 @@
<div class="field">
<TextInput
input-id="post-code"
name="zip"
v-model="formData.postcode.value"
:placeholder="$t( 'form_for_example', { example: $t( 'donation_form_zip_placeholder' ) } )"
:has-error="showError.postcode"
Expand Down
3 changes: 3 additions & 0 deletions src/components/shared/form_inputs/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
v-if="inputType === 'text'"
class="input"
:id="inputId"
:name="name"
:class="{ 'is-danger': hasError }"
type="text"
:autocomplete="newAutocomplete"
Expand All @@ -19,6 +20,7 @@
v-if="inputType === 'textarea'"
class="textarea"
:id="inputId"
:name="name"
:class="{ 'is-danger': hasError }"
:maxlength="maxlength"
:value="computedValue"
Expand All @@ -44,6 +46,7 @@ export default defineComponent( {
name: 'TextInput',
props: {
modelValue: [ String, Number ],
name: String,
autocomplete: String,
maxlength: [ Number, String ],
hasError: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ exports[`DateOfBirth.vue renders error message 1`] = `
autocomplete="on"
class="input is-danger"
id="birthDate"
name="birthDate"
placeholder="membership_form_birth_date_placeholder"
type="text"
/>
Expand Down Expand Up @@ -59,6 +60,7 @@ exports[`DateOfBirth.vue renders field 1`] = `
autocomplete="on"
class="input"
id="birthDate"
name="birthDate"
placeholder="membership_form_birth_date_placeholder"
type="text"
/>
Expand Down
Loading