Skip to content

Commit f068fda

Browse files
committed
Add feature of handling something before calling onPress func
1 parent 4526671 commit f068fda

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/components/dropdown/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ export default class Dropdown extends PureComponent {
7676
],
7777

7878
useNativeDriver: false,
79+
80+
preprocessFunc: () => null
7981
};
8082

8183
static propTypes = {
@@ -153,6 +155,8 @@ export default class Dropdown extends PureComponent {
153155
supportedOrientations: PropTypes.arrayOf(PropTypes.string),
154156

155157
useNativeDriver: PropTypes.bool,
158+
159+
preprocessFunc: PropTypes.func
156160
};
157161

158162
constructor(props) {
@@ -214,8 +218,17 @@ export default class Dropdown extends PureComponent {
214218
animationDuration,
215219
absoluteRTLLayout,
216220
useNativeDriver,
221+
preprocessFunc
217222
} = this.props;
218223

224+
if (
225+
preprocessFunc &&
226+
typeof preprocessFunc === "function" &&
227+
!disabled
228+
) {
229+
preprocessFunc();
230+
}
231+
219232
if (disabled) {
220233
return;
221234
}

0 commit comments

Comments
 (0)