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

DatePicker is calling onFocus/onBlur two times #11249

Closed
1 task done
fantua opened this issue Jul 11, 2018 · 6 comments
Closed
1 task done

DatePicker is calling onFocus/onBlur two times #11249

fantua opened this issue Jul 11, 2018 · 6 comments
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug. help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request. Inactive

Comments

@fantua
Copy link

fantua commented Jul 11, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.6.6

Environment

any

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. Open console
  2. Open DatePicker
  3. Close DatePicker
  4. Look at the console output

What is expected?

Call onFocus/onBlur one time

What is actually happening?

DatePicker is calling onFocus/onBlur two times

@afc163 afc163 added 🐛 Bug Ant Design Team had proved that this is a bug. help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request. and removed Inactive labels Feb 21, 2019
@Yangzhedi
Copy link
Contributor

let me have a try ? @afc163

@ztplz
Copy link
Contributor

ztplz commented Feb 22, 2019

@Yangzhedi Sure.

@Yangzhedi
Copy link
Contributor

hi guys, I am not sure enough if my idea is correct.
I think this bug maybe caused by onFocus/onBlur was bind on span tag which wrapped the Pickers, and the onFocus/onBlur function not related to Picker`s open state. so onFocus called the second time when Picker has opened, so do onBlur.
maybe we should use open state to control the onFocus/onBlur?

@zombieJ
Copy link
Member

zombieJ commented Feb 25, 2019

It triggered by different input element. First one is origin input element, second one is popup input element. Maybe we can merge these onFocus -> onBlur -> onFocus into one onFocus:
2019-02-25 3 13 58

@Yangzhedi
Copy link
Contributor

like this?react-component/calendar#519

@kerm1it
Copy link
Member

kerm1it commented Jun 15, 2020

It's normal in 4.3.4, https://codesandbox.io/s/427yy09wo7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug. help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request. Inactive
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants