Skip to content

Commit

Permalink
Add feature of handling something before calling onPress func
Browse files Browse the repository at this point in the history
  • Loading branch information
7772 committed Dec 3, 2018
1 parent 4526671 commit e364bb1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ export default class Dropdown extends PureComponent {
supportedOrientations: PropTypes.arrayOf(PropTypes.string),

useNativeDriver: PropTypes.bool,

preprocessFunc: PropTypes.func
};

constructor(props) {
Expand Down Expand Up @@ -214,8 +216,17 @@ export default class Dropdown extends PureComponent {
animationDuration,
absoluteRTLLayout,
useNativeDriver,
preprocessFunc
} = this.props;

if (
preprocessFunc &&
typeof preprocessFunc === "function" &&
!disabled
) {
preprocessFunc();
}

if (disabled) {
return;
}
Expand Down

0 comments on commit e364bb1

Please sign in to comment.