Skip to content

Commit

Permalink
fix: pagination button activeStyle, because of disabled prop and stat…
Browse files Browse the repository at this point in the history
…e.pressIn bug with button, ref #1199
  • Loading branch information
silentcloud committed May 9, 2017
1 parent da16e0d commit 1b01652
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions components/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,25 @@ export default class Button extends React.Component<tsProps, any> {
}

onPressIn = (...arg) => {
if (!this.props.disabled) {
this.setState({ pressIn: true });
}
this.setState({ pressIn: true });
if (this.props.onPressIn) {
(this.props.onPressIn as any)(...arg);
}
}
onPressOut = (...arg) => {
if (!this.props.disabled) {
this.setState({ pressIn: false });
}
this.setState({ pressIn: false });
if (this.props.onPressOut) {
(this.props.onPressOut as any)(...arg);
}
}
onShowUnderlay = (...arg) => {
if (!this.props.disabled) {
this.setState({ touchIt: true });
}
this.setState({ touchIt: true });
if (this.props.onShowUnderlay) {
(this.props.onShowUnderlay as any)(...arg);
}
}
onHideUnderlay = (...arg) => {
if (!this.props.disabled) {
this.setState({ touchIt: false });
}
this.setState({ touchIt: false });
if (this.props.onHideUnderlay) {
(this.props.onHideUnderlay as any)(...arg);
}
Expand Down

0 comments on commit 1b01652

Please sign in to comment.