react-native-date-ranges icon indicating copy to clipboard operation
react-native-date-ranges copied to clipboard

Question: Cancel button?

Open bvelasquez opened this issue 4 years ago • 3 comments

Is there a way to add a cancel button to the date selection? Currently, if the user does not select a date range, they just get an error.

Thank you!

bvelasquez avatar Jun 09 '20 15:06 bvelasquez

I'm also interested in this!

mkausas avatar Aug 19 '20 22:08 mkausas

Yes it seems this important feature is missing.

JeremyBradshaw7 avatar Sep 16 '20 13:09 JeremyBradshaw7

This is how you close the modal with out selecting input. Add a ref to the component and access the setModalVisible

 customButton={(onConfirm) => (
          <View style={{ flex: 1, marginHorizontal: 20, marginTop: -30 }}>
            <Button
              variant={'primary'}
              buttonText="Select Range"
              textColor={theme.primarySurface}
              onPress={onConfirm}
            />
            <Button
              variant={'transparent'}
              buttonText="Cancel"
              textColor={theme.primaryColor}
              onPress={() => ref.current.setModalVisible(false)}
            />
          </View>
        )}
      />

Harkindey avatar Mar 17 '21 05:03 Harkindey