Skip to content

Commit

Permalink
fix: resolve issue with nested checkboxes (resolves #253) (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ned Zimmerman committed Feb 20, 2020
1 parent c931d80 commit 047b918
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/assets/scripts/Pinecone/NestedCheckbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
} );
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/button/button.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if not standAlone %}<div class="spacer"></div>{% endif %}
<button {% if id %}id="{{ id }}" {% endif %}type="button" class="button{% if modifiers %}{% for modifier in modifiers %} button--{{ modifier }}{% endfor %}{% endif %}{% if className %} {{ className }}{% endif %}">
<button {% if id %}id="{{ id }}" {% endif %}type="{{ type }}" class="button{% if modifiers %}{% for modifier in modifiers %} button--{{ modifier }}{% endfor %}{% endif %}{% if className %} {{ className }}{% endif %}">
{% if icon and iconPosition === 'start' %}{% render '@svg', {svg:icon}, true %}{% endif %}<span class="button__label{{ ' screen-reader-text' if labelVisuallyHidden }}">{{ label | safe }}</span>{% if icon and iconPosition === 'end' %}{% render '@svg', {svg:icon}, true %}{% endif %}
</button>
2 changes: 1 addition & 1 deletion src/components/layouts/archive/archive.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% render '@filter-list', {standAlone: true, label: filterList.label, terms: filterList.terms}, true %}
{% endfor %}
</div>
{% render '@submit', {standAlone: true, value: 'Apply filters', id: 'apply-filters'} %}
{% render '@submit', {standAlone: true, label: 'Apply filters', id: 'apply-filters'}, true %}
</form>
</div>
<div class="sort-wrapper">
Expand Down
2 changes: 1 addition & 1 deletion src/components/layouts/search-results/search-results.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% render '@filter-list', {standAlone: true, label: filterList.label, terms: filterList.terms}, true %}
{% endfor %}
</div>
{% render '@submit', {standAlone: true, value: 'Apply filters', id: 'apply-filters'} %}
{% render '@submit', {standAlone: true, label: 'Apply filters', id: 'apply-filters'}, true %}
</form>
</div>
<div class="sort-wrapper">
Expand Down

0 comments on commit 047b918

Please sign in to comment.