CalendarPicker icon indicating copy to clipboard operation
CalendarPicker copied to clipboard

show 'previosu' and 'next' button triggering even tho the value is not wanted

Open MSetnik opened this issue 1 year ago • 0 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Im facing the problem when i dont want to show 'previosu' and 'next' button in the calendar header for month change, im still triggering the TouchableOpacity press even tho i have forwarded in nextComponent null value or empty view

nextComponent={() => <></>} nextComponent={() => null} nextComponent={null}

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-calendar-picker/CalendarPicker/Controls.js b/node_modules/react-native-calendar-picker/CalendarPicker/Controls.js
index ab9b9f5..cda0d3b 100644
--- a/node_modules/react-native-calendar-picker/CalendarPicker/Controls.js
+++ b/node_modules/react-native-calendar-picker/CalendarPicker/Controls.js
@@ -16,6 +16,8 @@ export default function Controls(props) {
     disabled,
   } = props;
 
+  if(component === null) return
+
   return (
     <TouchableOpacity
       onPress={() => onPressControl()}

This issue body was partially generated by patch-package.

MSetnik avatar Sep 19 '24 13:09 MSetnik