Browse Source

fix: model close (#18323)

* 💄 support Modal closeIcon

close #18307

* 🐛 closeIcon should put into span

https://github.com/ant-design/ant-design/pull/18309/files#r314946527
pull/18327/head
偏右 5 years ago
committed by GitHub
parent
commit
9b3ac9bbd1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      components/modal/Modal.tsx
  2. 10
      components/modal/__tests__/__snapshots__/Modal.test.js.snap

4
components/modal/Modal.tsx

@ -223,9 +223,9 @@ export default class Modal extends React.Component<ModalProps, {}> {
</LocaleReceiver>
);
const closeIconToRender = closeIcon || (
const closeIconToRender = (
<span className={`${prefixCls}-close-x`}>
<Icon className={`${prefixCls}-close-icon`} type="close" />
{closeIcon || <Icon className={`${prefixCls}-close-icon`} type="close" />}
</span>
);

10
components/modal/__tests__/__snapshots__/Modal.test.js.snap

@ -198,9 +198,13 @@ exports[`Modal support closeIcon 1`] = `
class="ant-modal-close"
type="button"
>
<a>
closeIcon
</a>
<span
class="ant-modal-close-x"
>
<a>
closeIcon
</a>
</span>
</button>
<div
class="ant-modal-body"

Loading…
Cancel
Save