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 onBlur 乱回调 #18913

Closed
1 task
iwangx opened this issue Sep 20, 2019 · 5 comments
Closed
1 task

DatePicker onBlur 乱回调 #18913

iwangx opened this issue Sep 20, 2019 · 5 comments
Assignees
Labels

Comments

@iwangx
Copy link

iwangx commented Sep 20, 2019

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

Reproduction link

Edit on CodeSandbox

Steps to reproduce

把代码复制到重现链接里面看控制台


import React from 'react';
import ReactDOM from 'react-dom';
import 'antd/dist/antd.css';
import './index.css';
import { DatePicker } from 'antd';

function onChange(date, dateString) {
  //console.log(date, dateString);
}

function onBlur(){
  console.log('onBlur')
}

ReactDOM.render(
  <div>
    <DatePicker showTime onBlur={onBlur} onChange={onChange} />
    <br />
  </div>,
  document.getElementById('container'),
);
          
          

What is expected?

期望在点击日期或者时间的时候不要执行onBlur回调

What is actually happening?

每次点击日期或者时间,或者其他操作都会执行onBlur回调

Environment Info
antd 3.23.3
React 16.7.0
System mac os
Browser chrome
@afc163
Copy link
Member

afc163 commented Sep 20, 2019

similar to #11249

@afc163
Copy link
Member

afc163 commented Sep 20, 2019

BTW @iwangx, you can save the codesandbox.

@iwangx
Copy link
Author

iwangx commented Sep 20, 2019

@afc163 复制那个代码到codesandbox 里面就可以了,只要是点击具体日期都会出发onBlur的回调,这是个大问题啊,我其实是选了值,但是并没有失去焦点啊?

@iwangx
Copy link
Author

iwangx commented Sep 20, 2019

@afc163
image
我猜测是这个文本框失焦导致的回调,因为这个也是一个input,并且是获得焦点的

@afc163
Copy link
Member

afc163 commented Mar 13, 2020

trace #11249

@afc163 afc163 closed this as completed Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants