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

fix(DatePicker2): Unable to enter space to enter time #4853

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

luolin-ck
Copy link
Collaborator

close #4790

);
const DatePicker_triggerClickKeycode = wrapper.find('Overlay').props()['triggerClickKeycode'];
assert(DatePicker_triggerClickKeycode.length === 0);
changeInput('2020-11-11 09:23:23');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉这个测试用例无法覆盖相应的变化,simulate change 是模拟的 change 事件,并不是一个一个字符输入进去的,因此无法模拟中间输入空格的情况,相当于把 2020-11-11 09:23:23 一下子输入进去。这个原本就是支持的。写测试用例还是应该遵循,首先用测试用例能复现 issue,然后再通过修改 src 来修复 issue。

@@ -745,6 +745,7 @@ class Picker extends React.Component {
}
onPosition={this.getCurrentAlign}
canCloseByTrigger={false}
triggerClickKeycode={[]}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥这里加入一个空数组就可以解这个问题了呢

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.

[DatePicker2]DatePicker2无法输入空格来输入时间
2 participants