Skip to content

Commit 42fd703

Browse files
spoeckmastermoo
authored andcommitted
add props onPressIn and onPressOut (#216)
* feat: add props onPressIn and onPressOut * doc: add props onPressIn and onPressOut
1 parent 49c6283 commit 42fd703

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ActionButton.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ export default class ActionButton extends Component {
200200
this.props.onPress();
201201
if (this.props.children) this.animateButton();
202202
}}
203+
onPressIn={this.props.onPressIn}
204+
onPressOut={this.props.onPressOut}
203205
>
204206
<Animated.View
205207
style={[
@@ -352,6 +354,8 @@ ActionButton.propTypes = {
352354
size: PropTypes.number,
353355
autoInactive: PropTypes.bool,
354356
onPress: PropTypes.func,
357+
onPressIn: PropTypes.func,
358+
onPressOut: PropTypes.func,
355359
backdrop: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
356360
degrees: PropTypes.number,
357361
verticalOrientation: PropTypes.oneOf(["up", "down"]),
@@ -375,6 +379,8 @@ ActionButton.defaultProps = {
375379
outRangeScale: 1,
376380
autoInactive: true,
377381
onPress: () => {},
382+
onPressIn: () => {},
383+
onPressOn: () => {},
378384
backdrop: false,
379385
degrees: 45,
380386
position: "right",

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ Take a look at [this gist](https://gist.github.com/mmazzarolo/cfd467436f9d110e94
102102
| btnOutRange | string | props.buttonColor | button background color to animate to
103103
| outRangeScale | number | 1 | changes size of button during animation
104104
| onPress | function | null | fires, when ActionButton is tapped
105+
| onPressIn | function | null | fires, before ActionButton is released
106+
| onPressOut | function | null | fires, after ActionButton is released
105107
| onLongPress | function | null | fires, when ActionButton is long pressed
106108
| icon | Component | + | Custom component for ActionButton Icon
107109
| backdrop | Component | false | Custom component for use as Backdrop (i.e. [BlurView](https://github.com/react-native-fellowship/react-native-blur#blur-view), [VibrancyView](https://github.com/react-native-fellowship/react-native-blur#vibrancy-view))

0 commit comments

Comments
 (0)