Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
476ace8a
A
ant-design
项目概览
wanjj_1210
/
ant-design
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
476ace8a
编写于
12月 21, 2018
作者:
H
HarlanLuo
提交者:
偏右
12月 21, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Transfer: fix search-not-found block sometimes not show in edge
上级
42cd5426
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
5 addition
and
69 deletion
+5
-69
components/transfer/__tests__/__snapshots__/demo.test.js.snap
...onents/transfer/__tests__/__snapshots__/demo.test.js.snap
+0
-10
components/transfer/__tests__/__snapshots__/index.test.js.snap
...nents/transfer/__tests__/__snapshots__/index.test.js.snap
+0
-20
components/transfer/__tests__/__snapshots__/list.test.js.snap
...onents/transfer/__tests__/__snapshots__/list.test.js.snap
+0
-5
components/transfer/list.tsx
components/transfer/list.tsx
+5
-29
components/transfer/style/index.less
components/transfer/style/index.less
+0
-5
未找到文件。
components/transfer/__tests__/__snapshots__/demo.test.js.snap
浏览文件 @
476ace8a
...
...
@@ -349,11 +349,6 @@ exports[`renders ./components/transfer/demo/basic.md correctly 1`] = `
style="height:32px"
/>
</ul>
<div
class="ant-transfer-list-body-not-found"
>
Not Found
</div>
</div>
</div>
<div
...
...
@@ -471,11 +466,6 @@ exports[`renders ./components/transfer/demo/basic.md correctly 1`] = `
style="height:32px"
/>
</ul>
<div
class="ant-transfer-list-body-not-found"
>
Not Found
</div>
</div>
</div>
</div>
...
...
components/transfer/__tests__/__snapshots__/index.test.js.snap
浏览文件 @
476ace8a
...
...
@@ -86,11 +86,6 @@ exports[`Transfer should render correctly 1`] = `
<span />
</li>
</ul>
<div
class="ant-transfer-list-body-not-found"
>
Not Found
</div>
</div>
</div>
<div
...
...
@@ -201,11 +196,6 @@ exports[`Transfer should render correctly 1`] = `
<span />
</li>
</ul>
<div
class="ant-transfer-list-body-not-found"
>
Not Found
</div>
</div>
</div>
</div>
...
...
@@ -277,11 +267,6 @@ exports[`Transfer should show sorted targetkey 1`] = `
</span>
</li>
</ul>
<div
class="ant-transfer-list-body-not-found"
>
Not Found
</div>
</div>
</div>
<div
...
...
@@ -419,11 +404,6 @@ exports[`Transfer should show sorted targetkey 1`] = `
</span>
</li>
</ul>
<div
class="ant-transfer-list-body-not-found"
>
Not Found
</div>
</div>
</div>
</div>
...
...
components/transfer/__tests__/__snapshots__/list.test.js.snap
浏览文件 @
476ace8a
...
...
@@ -102,11 +102,6 @@ exports[`List should render correctly 1`] = `
<span />
</li>
</ul>
<div
class="ant-transfer-list-body-not-found"
>
Not Found
</div>
</div>
</div>
`;
components/transfer/list.tsx
浏览文件 @
476ace8a
...
...
@@ -9,10 +9,6 @@ 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
()
{}
function
isRenderResultPlainObject
(
result
:
any
)
{
...
...
@@ -59,7 +55,6 @@ export default class TransferList extends React.Component<TransferListProps, any
timer
:
number
;
triggerScrollTimer
:
number
;
fixIERepaintTimer
:
number
;
notFoundNode
:
HTMLDivElement
;
constructor
(
props
:
TransferListProps
)
{
...
...
@@ -80,7 +75,6 @@ export default class TransferList extends React.Component<TransferListProps, any
componentWillUnmount
()
{
clearTimeout
(
this
.
timer
);
clearTimeout
(
this
.
triggerScrollTimer
);
clearTimeout
(
this
.
fixIERepaintTimer
);
}
shouldComponentUpdate
(...
args
:
any
[])
{
...
...
@@ -117,12 +111,10 @@ export default class TransferList extends React.Component<TransferListProps, any
triggerEvent
(
listNode
,
'
scroll
'
);
}
},
0
);
this
.
fixIERepaint
();
};
handleClear
=
()
=>
{
this
.
props
.
handleClear
();
this
.
fixIERepaint
();
};
matchFilter
=
(
text
:
string
,
item
:
TransferItem
)
=>
{
...
...
@@ -143,24 +135,6 @@ export default class TransferList extends React.Component<TransferListProps, any
};
};
saveNotFoundRef
=
(
node
:
HTMLDivElement
)
=>
{
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
,
...
...
@@ -236,6 +210,10 @@ export default class TransferList extends React.Component<TransferListProps, any
</
div
>
)
:
null
;
const
searchNotFound
=
showItems
.
every
(
item
=>
item
===
null
)
&&
(
<
div
className
=
{
`
${
prefixCls
}
-body-not-found`
}
>
{
notFoundContent
}
</
div
>
);
const
listBody
=
bodyDom
||
(
<
div
className
=
{
classNames
(
...
...
@@ -252,9 +230,7 @@ export default class TransferList extends React.Component<TransferListProps, any
>
{
showItems
}
</
Animate
>
<
div
className
=
{
`
${
prefixCls
}
-body-not-found`
}
ref
=
{
this
.
saveNotFoundRef
}
>
{
notFoundContent
}
</
div
>
{
searchNotFound
}
</
div
>
);
...
...
components/transfer/style/index.less
浏览文件 @
476ace8a
...
...
@@ -125,17 +125,12 @@
padding-top: 0;
color: @disabled-color;
text-align: center;
display: none;
position: absolute;
top: 50%;
width: 100%;
margin-top: -10px;
}
&-content:empty + &-body-not-found {
display: block;
}
&-footer {
border-top: @border-width-base @border-style-base @border-color-split;
border-radius: 0 0 @border-radius-base @border-radius-base;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录