Skip to content

Commit

Permalink
Merge pull request #504 from recurly/fix-tabbing-mobile
Browse files Browse the repository at this point in the history
Fixes detection of tabbing order on mobile browsers
  • Loading branch information
Aaron Suarez authored Jan 17, 2019
2 parents 3466b44 + 07d5606 commit a87b9f1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion lib/recurly/hosted-fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,14 @@ export class HostedFields extends Emitter {
if (destination) destination.focus();
}

/**
* Provides an Array of tabbable Elements in the document body,
* excluding those which correspond to hosted field iframes
* @return {Array} Elements
*/
tabbableItems () {
return tabbable(window.document.body);
const fieldFrames = this.fields.map(f => f.iframe);
return tabbable(window.document.body).filter(el => !~fieldFrames.indexOf(el));
}

update (body) {
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"lodash.pick": "^4.4.0",
"promise": "^8.0.2",
"qs": "^6.5.2",
"tabbable": "^3.1.1",
"tabbable": "^3.1.2",
"to-slug-case": "^1.0.0",
"uuid": "^3.3.2"
},
Expand Down

0 comments on commit a87b9f1

Please sign in to comment.