Skip to content

Commit

Permalink
fix(curtain): 处理冒泡
Browse files Browse the repository at this point in the history
  • Loading branch information
jimczj committed Dec 19, 2018
1 parent fd7fbb0 commit 47f2ee6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/curtain/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ export default class AtCurtain extends AtComponent {
onClose: PropTypes.func
}

onClose () {
onClose (e) {
e.stopPropagation()
this.props.onClose(...arguments)
}

_stopPropagation (e) {
e.stopPropagation()
}

render () {
const {
className,
Expand All @@ -51,6 +56,7 @@ export default class AtCurtain extends AtComponent {
}, className)
}
style={customStyle}
onClick={this._stopPropagation}
>
<View className='at-curtain__container'>
<View className='at-curtain__body'>
Expand All @@ -62,12 +68,12 @@ export default class AtCurtain extends AtComponent {
'at-curtain__close-box--top': closeBtnPosition === 'top'
})
}
onClick={this.onClose.bind(this)}
>
<AtIcon
customStyle={{ fontSize: '30px' }}
value='close-circle'
color='#fff'
onClick={this.onClose.bind(this)}
/>
</View>
</View>
Expand Down

0 comments on commit 47f2ee6

Please sign in to comment.