fix #12399. Hide title if is not string

This commit is contained in:
zombiej 2018-09-25 19:32:08 +08:00
parent 1c85bb3b62
commit 463d3c72f9

View File

@ -16,10 +16,15 @@ export default class Item extends React.Component<any, any> {
[`${prefixCls}-content-item-disabled`]: item.disabled,
});
let title: string | undefined = undefined;
if (typeof renderedText === 'string' || typeof renderedText === 'number') {
title = String(renderedText);
}
const listItem = (
<li
className={className}
title={renderedText}
title={title}
onClick={item.disabled ? undefined : () => onClick(item)}
>
<Checkbox checked={checked} disabled={item.disabled} />