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

onBlur execute while entring the date #651

Open
2 tasks done
NematAnsari opened this issue Feb 20, 2024 · 1 comment
Open
2 tasks done

onBlur execute while entring the date #651

NematAnsari opened this issue Feb 20, 2024 · 1 comment
Labels
bug Something isn't working stale

Comments

@NematAnsari
Copy link

Before you start - checklist

  • I followed instructions in documentation written for my React-Date-Picker version
  • I have checked if this bug is not already reported

Description

actually I disable calendar and i am manually entering the date while iam entring date onblur functions executes instead of iam clicking any where or focusing out as i enter day on blur executes how can i prevent them from executing until iam not clicking any where

<DatePicker
calendarClassName={appStyles.bfpDatePickerCalendar}
className={appStyles.bfpDatePicker}
format={appConstants.datePickerFormat}
value={values.main_applicant}
dayPlaceholder='dd'
monthPlaceholder='mm'
yearPlaceholder='yyyy'
id='main_applicant'
onChange={(value) => {
setFieldValue("main_applicant", value);
}}
onBlur={handleBlur("main_applicant")}
onKeyDown={(e: any) => {
const inputValue = e.target.value;
const year = inputValue.slice(-4);
if (year.length === 4 && e.key.length === 1) {
e.preventDefault();
}
}}
calendarIcon={() => {
return ;
}}
clearIcon={() => {
return ;
}}
disableCalendar={true}
/>

Steps to reproduce

first disable calendar and start date manually

Expected behavior

after i enter date then show touched true else false

Actual behavior

touched becomes true while iam entering the date

Additional information

............................

Environment

  • Browser (if applicable):
  • React-Date-Picker version:
  • React version:
@NematAnsari NematAnsari added the bug Something isn't working label Feb 20, 2024
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

@github-actions github-actions bot added the stale label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

1 participant