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 f068fda
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export default class Dropdown extends PureComponent {
],

useNativeDriver: false,

preprocessFunc: () => null
};

static propTypes = {
Expand Down Expand Up @@ -153,6 +155,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 +218,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 f068fda

Please sign in to comment.