Skip to content

Pressing Enter in <DatePicker /> submits form #21181

@samit4me

Description

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

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Place cursor into DatePicker input, press enter

What is expected?

The DatePicker calendar should disappear.

What is actually happening?

The DatePicker calendar does disappear, but the form is also submitting.

Environment Info
antd 4.0.0-rc.3
React 16.12.0
System Ubuntu 18.04.3 LTS
Browser Chrome 79

In Ant v3 pressing enter would toggle the calendar open/closed without submitting the form, see https://codesandbox.io/s/busy-gagarin-knbjw

In Ant v4 pressing enter still toggles the calendar open/closed, but it's also submitting the form. see https://codesandbox.io/s/angry-wright-selu2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions