-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
When [Bug Report] readony and clearable exist at the same time, the content can be emptied. #11959
Comments
Translation of this issue: Element UI version OS/Browsers version Vue version Reproduction Link Steps to reproduce What is Expected? What is actually happening? |
@viewweiwu 其实,我觉得这并不算是一个 bug。设置 readonly 属性后,用户无法修改 input 的 value。但是通过 js 依然可以修改 value,而点击清除按钮是通过 js 的方式修改 value。 |
@viewweiwu 当 readonly 为 true 时,就不再显示后面的清除按钮。https://jsfiddle.net/zhiyang/ubtc8453/5/ |
@ziyoung 我觉得可以做成如果是 readonly 时,不显示 clearable 按钮 |
我觉得还是交给用户来控制吧,也许更灵活一点。@jikkai 怎么看? |
我个人倾向 readonly 时即使设置了 clearable 也不应该显示清除按钮,这个灵活性对用户来说好像没什么意义 |
Element UI version
2.4.3
OS/Browsers version
chrome67 / win10
Vue version
2.5.17-beta.0
Reproduction Link
https://jsfiddle.net/ubtc8453/1/
Steps to reproduce
点击 input 后面的 x,内容会被清空
What is Expected?
不清空内容
What is actually happening?
内容会被清空
The text was updated successfully, but these errors were encountered: