Skip to content

Commit daccfd1

Browse files
committed
fix: fixed the issue that when the Alert is in closable, the icon will be covered by the text.
1 parent 43a503f commit daccfd1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

components/alert/index.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,20 @@ const Alert = {
103103
}
104104
}
105105

106+
// closeable when closeText is assigned
107+
if (closeText) {
108+
closable = true
109+
}
110+
106111
const alertCls = classNames(prefixCls, {
107112
[`${prefixCls}-${type}`]: true,
108113
[`${prefixCls}-close`]: !closing,
109114
[`${prefixCls}-with-description`]: !!description,
110115
[`${prefixCls}-no-icon`]: !showIcon,
111116
[`${prefixCls}-banner`]: !!banner,
117+
[`${prefixCls}-closable`]: closable,
112118
})
113119

114-
// closeable when closeText is assigned
115-
if (closeText) {
116-
closable = true
117-
}
118-
119120
const closeIcon = closable ? (
120121
<a onClick={this.handleClose} class={`${prefixCls}-close-icon`}>
121122
{closeText || <Icon type='close' />}

0 commit comments

Comments
 (0)