Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
fix: 当Select为木偶组件时,点击选项不触发onChange
Browse files Browse the repository at this point in the history
  • Loading branch information
shenlq committed Nov 1, 2016
1 parent 7edd7f5 commit 432f440
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions site/src/scripts/components/impression/components/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ export default class Select extends PureComponent {
value = this.isPuppet ? this.props.value : this.state.value;

// 木偶组件
if(this.isPuppet) {
onChange && newValue !== value && onChange(newValue, text, index);
} else {
if(!this.isPuppet) {
this.setState({
value: newValue,
}, () => {
Expand Down
4 changes: 1 addition & 3 deletions src/scripts/components/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ export default class Select extends PureComponent {
value = this.isPuppet ? this.props.value : this.state.value;

// 木偶组件
if(this.isPuppet) {
onChange && newValue !== value && onChange(newValue, text, index);
} else {
if(!this.isPuppet) {
this.setState({
value: newValue,
}, () => {
Expand Down

0 comments on commit 432f440

Please sign in to comment.