-
Notifications
You must be signed in to change notification settings - Fork 334
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
Enhanced File Upload NVDA Fix #5587
Open
patrickpatrickpatrick
wants to merge
1
commit into
spike-enhanced-file-upload
Choose a base branch
from
enhanced-file-upload-nvda-fix
base: spike-enhanced-file-upload
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Enhanced File Upload NVDA Fix #5587
patrickpatrickpatrick
wants to merge
1
commit into
spike-enhanced-file-upload
from
enhanced-file-upload-nvda-fix
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
govuk-design-system-ci
temporarily deployed
to
govuk-frontend-pr-5587
January 9, 2025 10:51
Inactive
patrickpatrickpatrick
changed the base branch from
main
to
spike-enhanced-file-upload
January 9, 2025 10:52
patrickpatrickpatrick
changed the title
enhanced file upload nvda fix
Enhanced File Upload NVDA Fix
Jan 9, 2025
romaricpascal
force-pushed
the
spike-enhanced-file-upload
branch
3 times, most recently
from
January 9, 2025 15:36
24dc2fd
to
9c6749f
Compare
patrickpatrickpatrick
force-pushed
the
enhanced-file-upload-nvda-fix
branch
from
January 9, 2025 16:12
9c88fdc
to
baaf4f7
Compare
📋 StatsFile sizes
Modules
View stats and visualisations on the review app Action run for baaf4f7 |
JavaScript changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.js b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.js
index 721a7e7fd..a37d255b6 100644
--- a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.js
+++ b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.js
@@ -763,9 +763,9 @@ class FileUpload extends GOVUKFrontendComponent {
const n = document.createElement("div");
n.className = "govuk-file-upload-wrapper";
const i = document.createElement("button");
- i.className = "govuk-button govuk-button--secondary govuk-file-upload__button", i.type = "button", i.innerText = this.i18n.t("selectFilesButton"), i.addEventListener("click", this.onClick.bind(this));
+ i.className = "govuk-button govuk-button--secondary govuk-file-upload__button", i.type = "button", i.innerText = this.i18n.t("selectFilesButton"), i.setAttribute("tabindex", "-1"), i.addEventListener("click", this.onClick.bind(this));
const s = document.createElement("span");
- s.className = "govuk-body govuk-file-upload__status", s.innerText = this.i18n.t("filesSelectedDefault"), s.setAttribute("role", "status"), n.insertAdjacentElement("beforeend", i), n.insertAdjacentElement("beforeend", s), this.$root.insertAdjacentElement("afterend", n), n.insertAdjacentElement("afterbegin", this.$root), this.$wrapper = n, this.$button = i, this.$status = s, this.$root.setAttribute("tabindex", "-1"), this.updateDisabledState(), this.observeDisabledState(), this.$root.addEventListener("change", this.onChange.bind(this)), this.$wrapper.addEventListener("drop", this.onDragLeaveOrDrop.bind(this)), document.addEventListener("dragenter", this.onDragEnter.bind(this)), document.addEventListener("dragleave", this.onDragLeaveOrDrop.bind(this))
+ s.className = "govuk-body govuk-file-upload__status", s.innerText = this.i18n.t("filesSelectedDefault"), s.setAttribute("role", "status"), n.insertAdjacentElement("beforeend", i), n.insertAdjacentElement("beforeend", s), this.$root.insertAdjacentElement("afterend", n), n.insertAdjacentElement("afterbegin", this.$root), this.$wrapper = n, this.$button = i, this.$status = s, this.updateDisabledState(), this.observeDisabledState(), this.$root.addEventListener("change", this.onChange.bind(this)), this.$wrapper.addEventListener("drop", this.onDragLeaveOrDrop.bind(this)), document.addEventListener("dragenter", this.onDragEnter.bind(this)), document.addEventListener("dragleave", this.onDragLeaveOrDrop.bind(this))
}
onChange() {
if (!("files" in this.$root)) return;
Action run for baaf4f7 |
Stylesheets changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
index f1b48d569..4b78902d2 100644
--- a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
+++ b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
@@ -3425,6 +3425,10 @@ screen and (forced-colors:active) {
margin-left: 10px
}
+.govuk-file-upload-wrapper:active button {
+ background-color: #fd0
+}
+
.govuk-footer {
font-family: GDS Transport, arial, sans-serif;
-webkit-font-smoothing: antialiased;
Action run for baaf4f7 |
Other changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/all.bundle.js b/packages/govuk-frontend/dist/govuk/all.bundle.js
index a2e6c5c58..14fd3812e 100644
--- a/packages/govuk-frontend/dist/govuk/all.bundle.js
+++ b/packages/govuk-frontend/dist/govuk/all.bundle.js
@@ -1694,6 +1694,7 @@
$button.className = 'govuk-button govuk-button--secondary govuk-file-upload__button';
$button.type = 'button';
$button.innerText = this.i18n.t('selectFilesButton');
+ $button.setAttribute('tabindex', '-1');
$button.addEventListener('click', this.onClick.bind(this));
const $status = document.createElement('span');
$status.className = 'govuk-body govuk-file-upload__status';
@@ -1706,7 +1707,6 @@
this.$wrapper = $wrapper;
this.$button = $button;
this.$status = $status;
- this.$root.setAttribute('tabindex', '-1');
this.updateDisabledState();
this.observeDisabledState();
this.$root.addEventListener('change', this.onChange.bind(this));
diff --git a/packages/govuk-frontend/dist/govuk/all.bundle.mjs b/packages/govuk-frontend/dist/govuk/all.bundle.mjs
index f261b255d..69e9e4b3a 100644
--- a/packages/govuk-frontend/dist/govuk/all.bundle.mjs
+++ b/packages/govuk-frontend/dist/govuk/all.bundle.mjs
@@ -1688,6 +1688,7 @@ class FileUpload extends GOVUKFrontendComponent {
$button.className = 'govuk-button govuk-button--secondary govuk-file-upload__button';
$button.type = 'button';
$button.innerText = this.i18n.t('selectFilesButton');
+ $button.setAttribute('tabindex', '-1');
$button.addEventListener('click', this.onClick.bind(this));
const $status = document.createElement('span');
$status.className = 'govuk-body govuk-file-upload__status';
@@ -1700,7 +1701,6 @@ class FileUpload extends GOVUKFrontendComponent {
this.$wrapper = $wrapper;
this.$button = $button;
this.$status = $status;
- this.$root.setAttribute('tabindex', '-1');
this.updateDisabledState();
this.observeDisabledState();
this.$root.addEventListener('change', this.onChange.bind(this));
diff --git a/packages/govuk-frontend/dist/govuk/components/file-upload/_index.scss b/packages/govuk-frontend/dist/govuk/components/file-upload/_index.scss
index 34e781c51..57c6f614f 100644
--- a/packages/govuk-frontend/dist/govuk/components/file-upload/_index.scss
+++ b/packages/govuk-frontend/dist/govuk/components/file-upload/_index.scss
@@ -96,6 +96,10 @@
margin-bottom: 0;
margin-left: govuk-spacing(2);
}
+
+ .govuk-file-upload-wrapper:active button {
+ background-color: $govuk-focus-colour;
+ }
}
/*# sourceMappingURL=_index.scss.map */
diff --git a/packages/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js b/packages/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js
index 69b24f51d..52ba0baee 100644
--- a/packages/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js
+++ b/packages/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js
@@ -495,6 +495,7 @@
$button.className = 'govuk-button govuk-button--secondary govuk-file-upload__button';
$button.type = 'button';
$button.innerText = this.i18n.t('selectFilesButton');
+ $button.setAttribute('tabindex', '-1');
$button.addEventListener('click', this.onClick.bind(this));
const $status = document.createElement('span');
$status.className = 'govuk-body govuk-file-upload__status';
@@ -507,7 +508,6 @@
this.$wrapper = $wrapper;
this.$button = $button;
this.$status = $status;
- this.$root.setAttribute('tabindex', '-1');
this.updateDisabledState();
this.observeDisabledState();
this.$root.addEventListener('change', this.onChange.bind(this));
diff --git a/packages/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs b/packages/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs
index 65b4aae36..59c885397 100644
--- a/packages/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs
@@ -489,6 +489,7 @@ class FileUpload extends GOVUKFrontendComponent {
$button.className = 'govuk-button govuk-button--secondary govuk-file-upload__button';
$button.type = 'button';
$button.innerText = this.i18n.t('selectFilesButton');
+ $button.setAttribute('tabindex', '-1');
$button.addEventListener('click', this.onClick.bind(this));
const $status = document.createElement('span');
$status.className = 'govuk-body govuk-file-upload__status';
@@ -501,7 +502,6 @@ class FileUpload extends GOVUKFrontendComponent {
this.$wrapper = $wrapper;
this.$button = $button;
this.$status = $status;
- this.$root.setAttribute('tabindex', '-1');
this.updateDisabledState();
this.observeDisabledState();
this.$root.addEventListener('change', this.onChange.bind(this));
diff --git a/packages/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs b/packages/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs
index a1ff0baf8..6023b3586 100644
--- a/packages/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs
@@ -44,6 +44,7 @@ class FileUpload extends GOVUKFrontendComponent {
$button.className = 'govuk-button govuk-button--secondary govuk-file-upload__button';
$button.type = 'button';
$button.innerText = this.i18n.t('selectFilesButton');
+ $button.setAttribute('tabindex', '-1');
$button.addEventListener('click', this.onClick.bind(this));
const $status = document.createElement('span');
$status.className = 'govuk-body govuk-file-upload__status';
@@ -56,7 +57,6 @@ class FileUpload extends GOVUKFrontendComponent {
this.$wrapper = $wrapper;
this.$button = $button;
this.$status = $status;
- this.$root.setAttribute('tabindex', '-1');
this.updateDisabledState();
this.observeDisabledState();
this.$root.addEventListener('change', this.onChange.bind(this));
Action run for baaf4f7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
tabindex="=-1"
from inputtabindex="-1"
to buttonWhy
Fix issue in which NVDA read out the button only and not the status of the input.