react-native-datepicker icon indicating copy to clipboard operation
react-native-datepicker copied to clipboard

Custom TouchableComponent does not bring up DatePicker on iOS.

Open arivanandan opened this issue 7 years ago • 4 comments

I passed a custom component through the TouchableComponent prop. I get the onPress function inside my custom component and call it onPress. This works fine on Android, but on iOS, though I see the onPress function being sent in (some native code) and the onPress function being called, the date-picker doesn't come up.

<DatePicker
  ...
  TouchableComponent={customTouchableComponent}
/>
customTouchableComponent = ({ onPress }) => (
  <TouchableHighlight onPress={onPress}>
    ...
  </TouchableHighlight>
);

Works on Android. Doesn't work on iOS.

not an overlap issue (zIndex, whatever) the onPress native code gets passed onPress gets triggered

arivanandan avatar Feb 27 '18 07:02 arivanandan

+1

brmk avatar May 15 '18 20:05 brmk

@arivanandan have you found a solution for this? Got the same problem.

dinealbrecht avatar Aug 23 '18 13:08 dinealbrecht

I worked around the issues initially, by manually calling onPressDate which brings up the date modal and getting the date as usual through onDateChange.

I moved to react-native-calendars after that because I needed to disable date ranges and such.

arivanandan avatar Aug 24 '18 13:08 arivanandan

I worked around the issues initially, by manually calling onPressDate which brings up the date modal and getting the date as usual through onDateChange.

I supposed I moved to react-native-calendars after that because I needed to disable date ranges and such.

Yes even I have worked around and created ready to use component for my use like this https://gist.github.com/ismusidhu/01d47c078955349df9473c41f5049a1d

ismusidhu avatar Feb 06 '20 12:02 ismusidhu