Skip to content

Commit

Permalink
Merge pull request #542 from recurly/hidden-input-accessibility
Browse files Browse the repository at this point in the history
Adds 'aria-hidden' tag to hidden input field
  • Loading branch information
chrissrogers authored Aug 29, 2019
2 parents 10bd141 + 2488d39 commit 7dd6508
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/util/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ function createHiddenInput (attributes = {}) {
let hidden = window.document.createElement(inputType);
if (!('type' in attributes)) attributes.type = 'text';
if (!('style' in attributes)) attributes.style = 'position: absolute; top: 0px; left: -1000px; opacity: 0;';
attributes['aria-hidden'] = true;

Object.keys(attributes).forEach(attr => hidden.setAttribute(attr, attributes[attr]));

Expand Down

0 comments on commit 7dd6508

Please sign in to comment.