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

fix: resolve issue with nested checkboxes (resolves #253) #255

Merged
merged 10 commits into from
Feb 20, 2020
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test and build
name: Run tests

on: [push]

Expand All @@ -12,10 +12,9 @@ jobs:
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
- name: npm install, build, and lint
- name: npm install and test
run: |
npm install
npm run build
npm test
env:
CI: true
18 changes: 0 additions & 18 deletions .github/workflows/publish-package.yml

This file was deleted.

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