diff --git a/specs/Modal.events.spec.js b/specs/Modal.events.spec.js index 8c9d5f2b..a6376707 100644 --- a/specs/Modal.events.spec.js +++ b/specs/Modal.events.spec.js @@ -128,6 +128,26 @@ export default () => { }); }); + it("traps tab in the modal on tab with radio button as last element", () => { + const topButton = ; + const radio1 = ; + const radio2 = ; + const modalContent = ( +
+ {topButton} + {radio1} + {radio2} +
+ ); + const props = { isOpen: true }; + withModal(props, modalContent, modal => { + const content = mcontent(modal); + tabKeyDown(content); + tabKeyDown(content); + document.activeElement.textContent.should.be.eql("top"); + }); + }); + describe("shouldCloseOnEsc", () => { context("when true", () => { it("should close on Esc key event", () => {