Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing overlapped date when open next time with old selected date #439

Open
getsettalk opened this issue Jan 15, 2025 · 1 comment
Open
Labels
bug Something isn't working needs repro Needs reproducible example

Comments

@getsettalk
Copy link

Current behaviour

When we select first time date showing fine and good .
but when we again open modal to select other date showing overlapped text , you can see in image.

here you can see our code:

index.js file:

registerTranslation('en-GB', enGB)

on profileScreen.jsx file:

    const [formData, setFormData] = useState({
        personalImage: null,
        firstName: '',
        middleName: '',
        lastName: '',
        dateOfBirth: null, // Set initial value as null
        email: '',
        referalCode: '',
    });


   <CustomTextInput
                        leftIcon={'calendar'}
                        label="Date of Birth"
                        placeholder="Select your Date of Birth"
                        value={formData.dateOfBirth || ''} // Default to empty string if null
                        onFocus={() => setDatePickerVisible(true)}
                        editable={true} // Prevent manual editing
                        error={!!errors.dateOfBirth}
                        errorText={errors.dateOfBirth}
                    />



 <DatePickerModal
                mode="single"
                presentationStyle='pageSheet'
                calendarIcon='calendar'
                locale='en-GB'
                visible={isDatePickerVisible}
                onDismiss={() => setDatePickerVisible(false)}
                date={
                    formData.dateOfBirth
                        ? dayjs(formData.dateOfBirth, 'DD-MM-YYYY').toDate()
                        : new Date()
                } // Convert to correct date format
                onConfirm={(params) => handleDateChange(params.date)}
            />

Expected behaviour

its should not overlapped i have used this formate date DD-MM-YYYY ,

How to reproduce?

Preview

image
image

What have you tried so far?

i have removed dayjs but still not wokring

Your Environment

software version
android 14
react-native 0.76.5
react-native-paper ^5.12.5
@getsettalk getsettalk added the bug Something isn't working label Jan 15, 2025
@iM-GeeKy iM-GeeKy added the needs repro Needs reproducible example label Jan 15, 2025
Copy link
Contributor

Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on snack.expo.dev. If it's not possible to repro it on snack.expo.dev, then you can also provide the repro in a GitHub repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs repro Needs reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants