From 047b918cbe5bd70c0bc7da5cfbf088928e3c3a17 Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Thu, 20 Feb 2020 08:35:28 -0700 Subject: [PATCH] fix: resolve issue with nested checkboxes (resolves #253) (#255) --- src/assets/scripts/Pinecone/NestedCheckbox/index.js | 6 +++--- src/components/atoms/button/button.njk | 2 +- src/components/layouts/archive/archive.njk | 2 +- src/components/layouts/search-results/search-results.njk | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/assets/scripts/Pinecone/NestedCheckbox/index.js b/src/assets/scripts/Pinecone/NestedCheckbox/index.js index 563faf0e..84da196e 100644 --- a/src/assets/scripts/Pinecone/NestedCheckbox/index.js +++ b/src/assets/scripts/Pinecone/NestedCheckbox/index.js @@ -51,8 +51,8 @@ class NestedCheckbox { supplementaryLabel.classList.add( 'screen-reader-text' ); supplementaryLabel.hidden = false; this.input.parentNode.insertBefore( customCheckbox, this.input ); - this.input.setAttribute( 'type', 'hidden' ); - this.input.setAttribute( 'value', status ? this.value : '' ); + this.input.classList.add( 'screen-reader-text' ); + this.input.setAttribute( 'aria-hidden', 'true' ); this.label.hidden = true; this.customCheckbox = customCheckbox; } @@ -72,7 +72,7 @@ class NestedCheckbox { toggleMixedCheckbox( ctrl ) { const state = 'true' === ctrl.getAttribute( 'aria-checked' ) || false; ctrl.setAttribute( 'aria-checked', !state ); - this.input.setAttribute( 'value', !state ? this.value : '' ); + this.input.checked = !state; Array.prototype.forEach.call( this.subInputs, checkbox => { checkbox.checked = !state; } ); diff --git a/src/components/atoms/button/button.njk b/src/components/atoms/button/button.njk index e0b163c7..89daf7cd 100644 --- a/src/components/atoms/button/button.njk +++ b/src/components/atoms/button/button.njk @@ -1,4 +1,4 @@ {% if not standAlone %}
{% endif %} - diff --git a/src/components/layouts/archive/archive.njk b/src/components/layouts/archive/archive.njk index 0c5fa8dc..d148c287 100644 --- a/src/components/layouts/archive/archive.njk +++ b/src/components/layouts/archive/archive.njk @@ -12,7 +12,7 @@ {% render '@filter-list', {standAlone: true, label: filterList.label, terms: filterList.terms}, true %} {% endfor %} - {% render '@submit', {standAlone: true, value: 'Apply filters', id: 'apply-filters'} %} + {% render '@submit', {standAlone: true, label: 'Apply filters', id: 'apply-filters'}, true %}
diff --git a/src/components/layouts/search-results/search-results.njk b/src/components/layouts/search-results/search-results.njk index 0abe88a8..63c0522d 100644 --- a/src/components/layouts/search-results/search-results.njk +++ b/src/components/layouts/search-results/search-results.njk @@ -12,7 +12,7 @@ {% render '@filter-list', {standAlone: true, label: filterList.label, terms: filterList.terms}, true %} {% endfor %}
- {% render '@submit', {standAlone: true, value: 'Apply filters', id: 'apply-filters'} %} + {% render '@submit', {standAlone: true, label: 'Apply filters', id: 'apply-filters'}, true %}