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

Disabled time can selected and onChange is triggered for that same. #20280

Closed
1 task done
balavishnuvj opened this issue Dec 16, 2019 · 3 comments
Closed
1 task done
Labels

Comments

@balavishnuvj
Copy link

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

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. Click on DatePicker/TimePicker.
  2. Select any time (for Datepicker select any date).
  3. Now the disabled time is selected(visible in UI). and onChange for the same is called.
  4. Click outside that modal. The selected value is still selected.

What is expected?

Disabled time shouldn't show in UI. onChange for invalid dates shouldn't be called.

What is actually happening?

Disabled time is shown. Even though ok is disabled. User can click outside modal and input will have the disabled value.

Environment Info
antd 3.26.3
React 16.12.0
System All
Browser All

ran into this bug, when the default value was not a valid date. But then select time was enabled. by this user can trick into selecting disabled time.

@afc163
Copy link
Member

afc163 commented Dec 16, 2019

If all hours are disabled, you should hide hour column by setting format="mm a".

@balavishnuvj
Copy link
Author

@afc163 even then am/pm will be enabled.

@zombieJ
Copy link
Member

zombieJ commented Feb 20, 2024

Picker component has been refactor in 5.14.0, and this issue is discussed and handled with react-component/picker#691 which will be marked as closed.

Please feel free to create new issue if you have any further question :)

Picker 组件于 5.14.0 版本进行了重构,此问题已被 react-component/picker#691 中进行讨论与处理。

如果有任何问题,欢迎随时创建新的 issue :)

@zombieJ zombieJ closed this as completed Feb 20, 2024
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

5 participants