Skip to content

TimePicker input should be readonly, like DatePicker #4084

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

Closed
1 task done
gaokun opened this issue May 14, 2021 · 6 comments
Closed
1 task done

TimePicker input should be readonly, like DatePicker #4084

gaokun opened this issue May 14, 2021 · 6 comments
Labels

Comments

@gaokun
Copy link
Contributor

gaokun commented May 14, 2021

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

Version

1.7.5 & 2.1.4

Environment

MacOS 10.13.4, Chrome 90.0.4430.212, Vue 2.6.10

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. choose a time, click outside to close popup
  2. select the time string in ATimePicker (mouse up outside, don't open popup) [框选时间内容, 鼠标在外面抬起, popup就不会弹出]
  3. press 'Delete'

What is expected?

input should be readonly like date picker, inputReadOnly only works on popup input

What is actually happening?

input is empty, but time value is still there

Here is video about issue recreating
https://user-images.githubusercontent.com/7044628/118246289-5958f280-b4d4-11eb-99cc-b65922cc7a9a.mp4

@John60676
Copy link
Member

出现这个问题是因为 vue 的受控组件行为跟 react 的不一致导致的。你这样直接把inputReadOnly给去掉了,这改法太粗暴了

@gaokun
Copy link
Contributor Author

gaokun commented May 16, 2021

@John60676
TimePicker 与 DatePicker组件都有两个input(正常显示的 和 popup时打开的)
我是参考了现在DatePicker的做法, 让inputReadOnly只作用于popup时的input, 而让外面的input始终保持readonly, 这样两个picker组件的行为就一致了.

的确, 如果将里面input值保持同步, 也是可以解决这个问题的. 只是与DatePicker行为就有差异了

我只是提出参考, 具体怎么做合适, andv团队的考虑肯定更全面

已经有4088了, 如果没问题的话, 回头我就把我提交的issue与两个pr close掉

@tangjinzhou
Copy link
Member

这里感觉直接 readonly 也可行 没发现有特别的分支 @John60676

@John60676
Copy link
Member

就目前看来,除了 input 上会多出个 readonly 属性外,没其他影响

@gaokun
Copy link
Contributor Author

gaokun commented May 24, 2021

@tangjinzhou
1.x的PR已经merged了, 2.x的PR commits的确没处理好. 官方就直接修改了吧, 我就不再重新提了
这个issue就close了

Thx
Ken

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants