diff --git a/components/transfer/list.tsx b/components/transfer/list.tsx index 483b277875..f0bb17731e 100644 --- a/components/transfer/list.tsx +++ b/components/transfer/list.tsx @@ -9,6 +9,10 @@ import Search from './search'; import Item from './item'; import triggerEvent from '../_util/triggerEvent'; +function isIEorEDGE() { + return (document as any).documentMode || /Edge/.test(navigator.userAgent); +} + function noop() { } @@ -52,6 +56,8 @@ export default class TransferList extends React.Component { this.props.handleClear(); + this.fixIERepaint(); } matchFilter = (text: string, item: TransferItem) => { @@ -131,6 +140,24 @@ export default class TransferList extends React.Component { + this.notFoundNode = node; + } + + // Fix IE/Edge repaint + // https://github.com/ant-design/ant-design/issues/9697 + // https://stackoverflow.com/q/27947912/3040605 + fixIERepaint() { + if (!isIEorEDGE()) { + return; + } + this.fixIERepaintTimer = window.setTimeout(() => { + if (this.notFoundNode) { + this.notFoundNode.className = this.notFoundNode.className; + } + }, 0); + } + render() { const { prefixCls, dataSource, titleText, checkedKeys, lazy, @@ -203,7 +230,7 @@ export default class TransferList extends React.Component {showItems} -
+
{notFoundContent}