Skip to content

Commit

Permalink
Add type='button' to modal close button [#153031749]
Browse files Browse the repository at this point in the history
Signed-off-by: Reid Mitchell <rmitchell@pivotal.io>
  • Loading branch information
sjolicoeur authored and apps-manager committed Nov 30, 2017
1 parent aee8267 commit b2acf7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions spec/pivotal-ui-react/modals/modals_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/react/modals/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class BaseModal extends mixin(React.PureComponent).with(Animation) {
<div className="modal-header">
<h3 className="modal-title em-high">{title}</h3>
<div className="modal-close">
<button className="btn btn-icon" onClick={onHide}>
<button className="btn btn-icon" onClick={onHide} type="button">
<Icon src="close"/>
</button>
</div>
Expand Down

0 comments on commit b2acf7f

Please sign in to comment.