Skip to content

Commit

Permalink
Moved input above label
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster authored Mar 5, 2020
2 parents 9d2512e + 4aec91f commit 82e05f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions less/gmcq.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

&__item-input {
position: absolute;
top: 50%;
bottom: @item-margin * 2;
left: 50%;
opacity: 0;
z-index: -1;
.transform(translate(-50%, -50%));
.transform(translate(-50%, 50%));
}

&__item-label {
Expand Down
4 changes: 2 additions & 2 deletions templates/gmcq.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
{{#each _items}}
<div class="gmcq__item js-mcq-item item-{{@index}} {{odd @index}}{{#unless ../_isEnabled}}{{#if ../_canShowMarking}}{{#if _isCorrect}} is-correct{{else}} is-incorrect{{/if}}{{/if}}{{/unless}}">

<input class="gmcq__item-input js-item-input" id="{{../_id}}-{{@index}}" {{#if ../_isRadio}}name="{{../_id}}-item" {{/if}} type="{{#if ../_isRadio}}radio{{else}}checkbox{{/if}}" {{#unless ../_isEnabled}} disabled{{/unless}} aria-label="{{{a11y_normalize text}}}" data-adapt-index="{{_index}}" />

<label class="gmcq__item-label js-item-label{{#unless ../_isEnabled}} is-disabled{{/unless}}{{#if _isSelected}} is-selected{{/if}}{{#if _graphic.attribution}} has-attribution{{/if}}" aria-hidden="true" for="{{../_id}}-{{@index}}" data-adapt-index="{{_index}}" >

<img class="gmcq__item-image" src="{{_graphic.src}}" data-large="{{_graphic.large}}" data-small="{{_graphic.small}}" {{#if _graphic.alt}}aria-label="{{_graphic.alt}}"{{else}}aria-hidden="true"{{/if}}>
Expand Down Expand Up @@ -45,8 +47,6 @@

</label>

<input class="gmcq__item-input js-item-input" id="{{../_id}}-{{@index}}" {{#if ../_isRadio}}name="{{../_id}}-item" {{/if}} type="{{#if ../_isRadio}}radio{{else}}checkbox{{/if}}" {{#unless ../_isEnabled}} disabled{{/unless}} aria-label="{{{a11y_normalize text}}}" data-adapt-index="{{_index}}" />

</div>
{{/each}}

Expand Down

0 comments on commit 82e05f0

Please sign in to comment.