Skip to content

Commit 2e55539

Browse files
Maksandrehepter
authored andcommitted
onPress prop
with selected item as param
1 parent 52b0ac0 commit 2e55539

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const propTypes = {
2727
onSearchFilterer: PropTypes.func,
2828
onChangeSearch: PropTypes.func,
2929
onChange: PropTypes.func,
30+
onPress: PropTypes.func,
3031
onModalOpen: PropTypes.func,
3132
onModalClose: PropTypes.func,
3233
onCancel: PropTypes.func,
@@ -99,6 +100,7 @@ const propTypes = {
99100
const defaultProps = {
100101
data: [],
101102
onChange: () => { },
103+
onPress: () => { },
102104
onModalOpen: () => { },
103105
onModalClose: () => { },
104106
onCancel: () => { },
@@ -228,6 +230,8 @@ export default class ModalSelector extends React.Component {
228230
}
229231

230232
open = (params = {}) => {
233+
this.props.onPress(this.validateSelectedKey(this.props.selectedKey));
234+
231235
if (!params.longPress && !this.props.enableShortPress) {
232236
return;
233237
}

0 commit comments

Comments
 (0)