Skip to content

Commit

Permalink
fix: 删除阻止冒泡代码
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchch6 committed Jun 30, 2020
1 parent 7bb7725 commit 4672af7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 26 deletions.
6 changes: 1 addition & 5 deletions src/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,6 @@ class DatePicker extends Component {
this.fireChange(value, newValue || '')
}
}
//阻止组件内部事件冒泡到组件外部容器
stopPropagation = (e) => {
e.stopPropagation();
}

fireChange = (value,stringValue)=>{
this.fileChange&&this.props.onChange(value,stringValue);
Expand Down Expand Up @@ -329,7 +325,7 @@ class DatePicker extends Component {
}
let classes = classnames(props.className, "datepicker-container");
return (
<div className={classes} onMouseEnter={this.onDateHover} onClick={this.stopPropagation}
<div className={classes} onMouseEnter={this.onDateHover}
{...omit(others, [
'onDateInputBlur',
'getCalendarContainer',
Expand Down
7 changes: 2 additions & 5 deletions src/MonthPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,7 @@ class MonthPicker extends Component {
})
this.props.onChange && this.props.onChange('', '');
}
//阻止组件内部事件冒泡到组件外部容器
stopPropagation = (e) => {
e.stopPropagation();
}

render() {
let state = this.state;
let props = this.props;
Expand All @@ -172,7 +169,7 @@ class MonthPicker extends Component {
/>;
let classes = classnames(props.className, "datepicker-container");
return (
<div className={classes} onClick={this.stopPropagation} onMouseOver={this.stopPropagation}
<div className={classes}
{...omit(others, [
'closeIcon',
'renderIcon',
Expand Down
7 changes: 2 additions & 5 deletions src/RangePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,7 @@ class RangePicker extends Component {
}
this.props.onEndInputBlur && this.props.onEndInputBlur(e, endValue, `["${startValue}" , "${endValue}"]`);
}
//阻止组件内部事件冒泡到组件外部容器
stopPropagation = (e) => {
e.stopPropagation();
}

onOk = (value) => {
this.props.onOk && this.props.onOk(value);
}
Expand Down Expand Up @@ -297,7 +294,7 @@ class RangePicker extends Component {
/>
);
return (
<div onClick={this.stopPropagation} onMouseOver={this.stopPropagation}
<div
{...omit(others, [
'closeIcon',
'renderIcon',
Expand Down
7 changes: 2 additions & 5 deletions src/WeekPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,7 @@ class WeekPicker extends Component {
})
this.props.onChange && this.props.onChange('', '');
}
//阻止组件内部事件冒泡到组件外部容器
stopPropagation = (e) => {
e.stopPropagation();
}

render() {
const state = this.state;
const props = this.props;
Expand All @@ -223,7 +220,7 @@ class WeekPicker extends Component {
);
let classes = classnames(props.className, "datepicker-container");
return (
<div className={classes} onClick={this.stopPropagation} onMouseOver={this.stopPropagation}
<div className={classes}
{...omit(others, [
'closeIcon',
'renderIcon',
Expand Down
7 changes: 1 addition & 6 deletions src/YearPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,6 @@ class YearPicker extends Component {
ReactDOM.findDOMNode(this.outInput).focus();
}

//阻止组件内部事件冒泡到组件外部容器
stopPropagation = (e) => {
e.stopPropagation();
}

render() {
let state = this.state;
let props = this.props;
Expand All @@ -165,7 +160,7 @@ class YearPicker extends Component {
/>;
let classes = classnames(props.className, "datepicker-container");
return (
<div className={classes} onClick={this.stopPropagation} onMouseOver={this.stopPropagation}
<div className={classes}
{...omit(others, [
'closeIcon',
'renderIcon',
Expand Down

0 comments on commit 4672af7

Please sign in to comment.