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

Remove non-operational value parameter from file upload component #5311

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ params:
type: string
required: true
description: The ID of the input.
- name: value
type: string
required: false
description: Optional initial value of the input.
- name: disabled
type: boolean
required: false
Expand Down Expand Up @@ -107,13 +103,6 @@ examples:
text: Your photo may be in your Pictures, Photos, Downloads or Desktop folder. Or in an app like iPhoto.
errorMessage:
text: Error message goes here
- name: with value
options:
id: file-upload-4
name: file-upload-4
value: C:\fakepath\myphoto.jpg
label:
text: Upload a photo
- name: with label as page heading
options:
id: file-upload-1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
{{ params.formGroup.beforeInput.html | safe | trim | indent(2) if params.formGroup.beforeInput.html else params.formGroup.beforeInput.text }}
{% endif %}
<input class="govuk-file-upload {%- if params.classes %} {{ params.classes }}{% endif %} {%- if params.errorMessage %} govuk-file-upload--error{% endif %}" id="{{ params.id }}" name="{{ params.name }}" type="file"
{%- if params.value %} value="{{ params.value }}"{% endif %}
{%- if params.disabled %} disabled{% endif %}
{%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %}
{{- govukAttributes(params.attributes) }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ describe('File upload', () => {
).toBeTruthy()
})

it('renders with value', () => {
const $ = render('file-upload', examples['with value'])

const $component = $('.govuk-file-upload')
expect($component.val()).toBe('C:\\fakepath\\myphoto.jpg')
})

it('renders with aria-describedby', () => {
const $ = render('file-upload', examples['with describedBy'])

Expand Down