修复 target 为 null 时的报错

This commit is contained in:
2betop 2020-03-26 11:47:25 +08:00
parent d262852aa1
commit cb7e2ac0f4

View File

@ -124,7 +124,7 @@ export default class DropDownButton extends React.Component<
onHide={this.close} onHide={this.close}
classPrefix={ns} classPrefix={ns}
className={cx('DropDown-popover')} className={cx('DropDown-popover')}
style={{minWidth: this.target.offsetWidth}} style={{minWidth: this.target?.offsetWidth}}
> >
{body} {body}
</PopOver> </PopOver>