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

DatePicker:(fix) init blank string data and async value performance in IE #13307

Closed
wants to merge 1 commit into from

Conversation

csvwolf
Copy link
Contributor

@csvwolf csvwolf commented Nov 6, 2018

#8548

Longlong ago bug...

From vuejs/vue#7138

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow Element's contributing guide (中文 | English | Español).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer relative issues for you PR.

@element-bot
Copy link
Member

Deploy preview for element ready!

Built with commit 4c9d5e1

https://deploy-preview-13307--element.netlify.com

@wacky6
Copy link
Contributor

wacky6 commented Nov 6, 2018

这个不能这么修。。userInput = null 是用来判断 input 是否 prestine 的。这么改了内部状态还是不对,组件认为用户已经有输入了,只是显示出来的不一样。

在 el-input 和 handle{Start, End}Input 里面判断是不是 IE 然后做处理比较好。

@csvwolf
Copy link
Contributor Author

csvwolf commented Nov 6, 2018

@wacky6 组件内部认为用户输入并且执行了 @input 但是其实内部输入(userInput)为 ''(就是外面 value 的值) handle xxx 的部分,我认为组件是否认为有输入且输入为空和并没有输入这个状态应该是一样的

我能想到的 1 是把 input 跟其他 handle 一样单独处理 '' 的情况并手动 userInput = null,2 是我提 pr 的这种方法,不过前一种比较肿……

如果这么判断会有什么 Bug?

@wacky6
Copy link
Contributor

wacky6 commented Nov 6, 2018

用户输入为空字符串是为了允许用户用退格键删掉日期,然后重新输入,这个时候显示出来的应该是空(等待用户输入)。

而没有任何输入(prestine)的话,显示出来的是当前选中的时间。

两者等同的话,会产生如下的效果 (选中日期,然后在输入框里面按「退格」):
qq20181106-233604

@wacky6 wacky6 mentioned this pull request Nov 19, 2018
6 tasks
@ziyoung ziyoung closed this Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants