Skip to content

Commit

Permalink
Merge pull request #186 from wmde/text-name-attribute
Browse files Browse the repository at this point in the history
Add name field to TextInput
  • Loading branch information
Abban authored Sep 18, 2023
2 parents a32b559 + 4fb7f22 commit 7d4b76e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
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

0 comments on commit 7d4b76e

Please sign in to comment.