From 7a63fcfc082e5484a38df794e41721518ed10ffa Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Tue, 5 Nov 2024 14:35:22 -0800 Subject: [PATCH] fix a11y errors --- app/assets/javascripts/enhancedTextbox.js | 12 +++++++++--- .../sass/uswds/_uswds-theme-custom-styles.scss | 5 ----- app/templates/components/folder-path.html | 2 +- app/templates/partials/jobs/notifications.html | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/enhancedTextbox.js b/app/assets/javascripts/enhancedTextbox.js index a4965857a..bd1a04882 100644 --- a/app/assets/javascripts/enhancedTextbox.js +++ b/app/assets/javascripts/enhancedTextbox.js @@ -73,10 +73,16 @@ ); this.update = () => { + const isEmpty = this.$textbox.val().trim() === ""; - this.$background.html( - this.highlightPlaceholders ? this.contentReplaced() : this.contentEscaped() - ); + if (isEmpty) { + this.$background.html( + this.highlightPlaceholders ? this.contentReplaced() : this.contentEscaped() + ); + this.$background.show(); + } else { + this.$background.hide(); + } this.resize(); diff --git a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss index fe98aed09..570c1082e 100644 --- a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss +++ b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss @@ -604,17 +604,12 @@ details form { } &-background { - position: absolute; - top: 0; - left: 0; pointer-events: none; - color: transparent; white-space: pre-wrap; overflow-wrap: break-word; word-wrap: break-word; border: 2px solid transparent; padding-bottom: units(3); - z-index: 10; // transparent borders become visible in high contrast modes so set to match background @media (-ms-high-contrast: active), (forced-colors: active) { diff --git a/app/templates/components/folder-path.html b/app/templates/components/folder-path.html index c686702ba..b6615a2da 100644 --- a/app/templates/components/folder-path.html +++ b/app/templates/components/folder-path.html @@ -22,7 +22,7 @@ {{ folder.name }} {% endif %} {% else %} - Templates + Templates {% endif %} {% if not loop.last %}{{ folder_path_separator() }}{% endif %} {% endif %} diff --git a/app/templates/partials/jobs/notifications.html b/app/templates/partials/jobs/notifications.html index 379a8efef..6df3085ee 100644 --- a/app/templates/partials/jobs/notifications.html +++ b/app/templates/partials/jobs/notifications.html @@ -2,7 +2,7 @@ {% from "components/page-footer.html" import page_footer %} {% from "components/form.html" import form_wrapper %} -
+
{% if job.scheduled %}