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

RangePicker does not support typing in start/end dates when in form #15673

Closed
1 task done
SaladFork opened this issue Mar 26, 2019 · 10 comments
Closed
1 task done

RangePicker does not support typing in start/end dates when in form #15673

SaladFork opened this issue Mar 26, 2019 · 10 comments
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug. Inactive

Comments

@SaladFork
Copy link

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

Reproduction link

https://ant.design/components/form/

Steps to reproduce

Working example (DatePicker outside form)

  • View first example in DatePicker documentation for RangePicker
  • Click on "Start date" to open range picker dropdown
  • Click on "Start date" text field at top of dropdown
  • Type in a date, e.g. 2019-01-01
  • Observe the day being selected in the calendar as a start
  • Click on "End date" at top (note click area is offset to the right, another bug has already been reported for this)
  • Type in a later date, e.g. 2019-01-04
  • Observe the range Jan 1 to Jan 4 is selected, and clicking off the dropdown maintains this selection

Broken example (DatePicker inside form)

  • View seventh example in Form documentation including RangePicker
  • Repeat the above steps to attempt to type in a start and end date
  • Note that after setting the start date, it is selected in the calendar but the input is cleared
  • Note that typing in an end date does not select it
  • Note that clicking out of the dropdown results in an empty state with no value

What is expected?

The RangePicker should behave the same when inside a form, allowing the start and end dates to be set by typing.

What is actually happening?

When in a form, the RangePicker gets stuck in an empty state

Environment Info
antd 3.15.2
React 16.5
System Mac OS
Browser Chrome
@ztplz
Copy link
Contributor

ztplz commented Apr 1, 2019

@SaladFork I downgraded the react to 16.3.0 and it's work for me. See this demo. But I am not sure if it is related to react.

@remyvanderwereld
Copy link

@ztplz This does not work for me. Is there an update yet?

@zombieJ zombieJ added the 🐛 Bug Ant Design Team had proved that this is a bug. label Apr 24, 2019
@remyvanderwereld
Copy link

No fix yet?

@ichirukia1566
Copy link

I am sorry for opening a duplicated issue, but is this going to be fixed?

@afc163
Copy link
Member

afc163 commented Aug 8, 2019

same as #17779

@annjawn
Copy link

annjawn commented Sep 12, 2019

Is there a fix for this yet? Still doesn't work with tabs and typed in values

@murny
Copy link

murny commented Nov 12, 2019

Encountered a very similar issue when setting "value" prop on RangePicker.

Without value prop, you can enter both start and end date without issues as noted above regarding outside a form:
<RangePicker onChange={onChange} />

With value prop, you get similar behaviour noted above regarding inside a form. After typing start date, input gets cleared when trying to type in end date:
<RangePicker onChange={onChange} value={[]} />

Could be related 🤔. Form could be setting the value prop?

@silent-tan
Copy link

silent-tan commented Dec 19, 2019

same issue https://codesandbox.io/s/crazy-mcclintock-31lnd .start date input will clear while i finish the start date input, touch tab key

@afc163
Copy link
Member

afc163 commented Mar 13, 2020

Fixed in antd v4 RangePicker.

@afc163 afc163 closed this as completed Mar 13, 2020
@rahulgsn178
Copy link

How can I get the fix of this issue. if anyone know please do reply.

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. Inactive
Projects
None yet
Development

No branches or pull requests