Skip to content

Commit

Permalink
Add more aria attributes to the buttons
Browse files Browse the repository at this point in the history
This should help make it clearer to screen readers what the
buttons are for.
  • Loading branch information
thomasleese committed Nov 8, 2018
1 parent 0a5cd50 commit a6fd25a
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions app/views/govuk_publishing_components/components/_feedback.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
'track-category' => 'yesNoFeedbackForm',
'track-action' => 'ffMaybeClick'
},
'aria-expanded': false,
role: 'button',
style: 'display: none;',
hidden: 'hidden',
'aria-hidden': 'true',
'aria-expanded': false,
} do %>
Maybe
<% end %>
Expand All @@ -31,35 +32,37 @@
data: {
'track-category' => 'yesNoFeedbackForm',
'track-action' => 'ffYesClick'
},
} do %>
Yes <span class="visually-hidden">this page is useful</span>
},
'aria-expanded': false,
role: 'button',
} do %>
Yes <span class="visually-hidden">this page is useful</span>
<% end %>

<%= link_to contact_govuk_path, {
class: 'gem-c-feedback__prompt-link js-toggle-form js-page-is-not-useful',
data: {
'track-category' => 'yesNoFeedbackForm',
'track-action' => 'ffNoClick'
},
'aria-controls': 'page-is-not-useful',
'aria-expanded': false,
'role': 'button'
} do %>
No <span class="visually-hidden">this page is not useful</span>
},
'aria-controls': 'page-is-not-useful',
'aria-expanded': false,
role: 'button',
} do %>
No <span class="visually-hidden">this page is not useful</span>
<% end %>

<%= link_to contact_govuk_path, {
class: 'gem-c-feedback__prompt-link gem-c-feedback__prompt-link--wrong js-toggle-form js-something-is-wrong',
data: {
'track-category' => 'Onsite Feedback',
'track-action' => 'GOV.UK Open Form'
},
'aria-controls': 'something-is-wrong',
'aria-expanded': false,
'role': 'button'
} do %>
Is there anything wrong with this page?
},
'aria-controls': 'something-is-wrong',
'aria-expanded': false,
role: 'button',
} do %>
Is there anything wrong with this page?
<% end %>
</div>

Expand Down

0 comments on commit a6fd25a

Please sign in to comment.