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

日期选择器键盘事件由 event.code 监控回车事件。小键盘回车事件无效。小键盘是 numpadenter。希望用e.key来判断或者加个numpadenter来判断。谢谢 #4545

Closed
Mr-city opened this issue Nov 26, 2021 · 10 comments · Fixed by #4563
Assignees

Comments

@Mr-city
Copy link

Mr-city commented Nov 26, 2021

No description provided.

@element-bot element-bot changed the title DatePicker 键盘事件用event.code 来监听,小键盘的enter不会生效,小键盘是NumpadEnter,希望能改成用 e.key 来判断,或者在加一个NumpadEnter判断,谢谢 Datepicker keyboard events are monitored with event.code. The enter of the keypad will not take effect. The keypad is numpadenter. I hope to use e.key to judge or add a numpadenter to judge. Thank you Nov 26, 2021
@element-bot
Copy link
Member

Translation of this issue:

@Mr-city Mr-city changed the title Datepicker keyboard events are monitored with event.code. The enter of the keypad will not take effect. The keypad is numpadenter. I hope to use e.key to judge or add a numpadenter to judge. Thank you 日期选择器键盘事件由 event.code 监控回车事件。小键盘回车事件无效。小键盘是 numpadenter。希望用e.key来判断或者加个numpadenter来判断。谢谢 Nov 26, 2021
@Alanscut Alanscut self-assigned this Nov 27, 2021
@Mr-city
Copy link
Author

Mr-city commented Nov 29, 2021

@Alanscut 可以添加一个numpadEnter的判断吗,表单全部加键盘事件后,按下numpadEnter 不能关闭日期,或者抛出一个关闭日期的属性

@Alanscut
Copy link
Contributor

Alanscut commented Nov 29, 2021

@Mr-city 这个pr里就是让enter和numpadEnter的行为一致,现在可以按下小键盘回车关闭弹出层了。

@Alanscut
Copy link
Contributor

@Mr-city https://preview-4563-element-plus.surge.sh/en-US/component/date-picker.html#enter-date
这个网址中可以查看这个pr修改后的效果

@Mr-city
Copy link
Author

Mr-city commented Nov 29, 2021

@Alanscut 这个版本多久更新了,还有可以抛出一个手动关闭日期的属性吗

@Alanscut
Copy link
Contributor

@Mr-city 我不理解为什么需要一个手动关闭日期的属性

@Mr-city
Copy link
Author

Mr-city commented Nov 30, 2021

@Alanscut 有一个业务场景,给form表单全部添加了键盘事件,上下左右加回车,按回车就定位到下一个,如果日期没输入值,按下回车定位到下一个,日期候选框是不会消失的,此时须要一个手动关闭的属性,日期现在也没有blur事件

@Alanscut
Copy link
Contributor

image

@Mr-city
Copy link
Author

Mr-city commented Nov 30, 2021

@Alanscut 这个事件不行,须手动执行一个blur方法,可以关闭日期
现在日期只有一个focus 方法

@Alanscut
Copy link
Contributor

Alanscut commented Dec 1, 2021

@Mr-city https://preview-4563-element-plus.surge.sh/en-US/component/date-picker.html#enter-date
你可以看一下现在,输入框为空时,可以直接使用enter关闭了。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants