From b2acf7fd1f30420727cf059e3610a5cba6ddd7f0 Mon Sep 17 00:00:00 2001 From: Stephane Jolicoeur Date: Thu, 30 Nov 2017 13:38:02 -0800 Subject: [PATCH] Add type='button' to modal close button [#153031749] Signed-off-by: Reid Mitchell --- spec/pivotal-ui-react/modals/modals_spec.js | 5 +++++ src/react/modals/modals.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/pivotal-ui-react/modals/modals_spec.js b/spec/pivotal-ui-react/modals/modals_spec.js index 51d360e64..7fab387c6 100644 --- a/spec/pivotal-ui-react/modals/modals_spec.js +++ b/spec/pivotal-ui-react/modals/modals_spec.js @@ -22,6 +22,11 @@ describe('Modals', () => { expect(findByClass(result, 'myModal')).toBeDefined(); }); + + it('renders a close button of type button', () => { + result.open(); + expect('.modal-close button.btn.btn-icon').toHaveAttr('type', 'button'); + }); }); describe('#close', () => { diff --git a/src/react/modals/modals.js b/src/react/modals/modals.js index b32c26b42..cd80d2314 100644 --- a/src/react/modals/modals.js +++ b/src/react/modals/modals.js @@ -149,7 +149,7 @@ export class BaseModal extends mixin(React.PureComponent).with(Animation) {

{title}

-