Skip to content

Add touch event props#9

Merged
MoOx merged 2 commits into
rescript-react-native:mainfrom
reck753:add-touch-event-props
Jun 20, 2021
Merged

Add touch event props#9
MoOx merged 2 commits into
rescript-react-native:mainfrom
reck753:add-touch-event-props

Conversation

@reck753
Copy link
Copy Markdown
Contributor

@reck753 reck753 commented Jun 13, 2021

Hi!

I added the missing touch event props:

  • onPress
  • onPressIn
  • onPressOut
  • onLongPress
  • disabled
  • delayPressIn
  • delayPressOut
  • delayLongPress

https://github.com/react-native-svg/react-native-svg#touch-events

@MoOx
Copy link
Copy Markdown
Member

MoOx commented Jun 15, 2021

Hi @reck753, thanks for this contribution! Could you adjust the onPress* to add the argument received (event).
It seems it's not correctly typed in the source https://github.com/react-native-svg/react-native-svg/blob/fa9a25d36b6f863d3148bdd5dd1ac76e91339402/src/ReactNativeSVG.web.ts#L18 but I am sure we could have something like Event.pressEvent => unit seems more accurate.

- change `onPress*` argument to `Event.pressEvent`
- change `delay*` type to `int`
@reck753
Copy link
Copy Markdown
Contributor Author

reck753 commented Jun 15, 2021

Hi @reck753, thanks for this contribution!

You are welcome!
I also adjusted the types for the delay* to int instead. I totally forgot that the value should be in milliseconds and that it doesn't make sense to be float. The type is int as well for RN pressables:
https://github.com/rescript-react-native/rescript-react-native/blob/e625be295df739f91f98b6e12855b4bcd7a6623d/src/components/TouchableOpacity.res#L23

@MoOx
Copy link
Copy Markdown
Member

MoOx commented Jun 20, 2021

Thanks!

@MoOx MoOx merged commit 0304f08 into rescript-react-native:main Jun 20, 2021
@MoOx
Copy link
Copy Markdown
Member

MoOx commented Jun 20, 2021

Released in 12.1.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants