From afcb7a912f5980777544e0e37887a124522a8242 Mon Sep 17 00:00:00 2001 From: Jorge Cloquell Date: Wed, 8 Mar 2023 01:33:50 +0100 Subject: [PATCH] Fix the allowEditing prop which was being accidentally ignored --- example/src/App.tsx | 4 ++++ src/Date/DatePickerModalContent.tsx | 2 +- src/Date/DatePickerModalContentHeader.tsx | 6 ++---- .../Date/__snapshots__/AnimatedCrossView.test.tsx.snap | 1 + src/__tests__/Date/__snapshots__/Calendar.test.tsx.snap | 1 + src/__tests__/Date/__snapshots__/YearPicker.test.tsx.snap | 1 + 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/example/src/App.tsx b/example/src/App.tsx index 570ec782..86e8a0fd 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -306,6 +306,8 @@ function App() { // animationType="slide" // optional, default is slide on ios/android and none on web // startYear={2000} // optional, default is 1800 // endYear={2100} // optional, default is 2200 + // allowEditing={false} // optional, default is true + // inputEnabled={false} // optional, default is true /> any locale: string | undefined - inputDate?: boolean } function getLabel( @@ -62,7 +61,6 @@ export default function DatePickerModalContentHeader( uppercase, editIcon, calendarIcon, - inputDate, allowEditing, } = props const theme = useTheme() @@ -70,7 +68,7 @@ export default function DatePickerModalContentHeader( const color = useHeaderTextColor() - const isAllowEditing = allowEditing && mode !== 'multiple' && inputDate !== undefined + const isEditingEnabled = allowEditing && mode !== 'multiple' const supportingTextColor = theme.isV3 ? theme.colors.onSurfaceVariant : color @@ -103,7 +101,7 @@ export default function DatePickerModalContentHeader( - {isAllowEditing ? ( + {isEditingEnabled ? (