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(directives): [repeat-click] Interval time is too short for single clicks #9466
Conversation
👋 @opuu, seems like this is your first time contribution to element-plus.
|
🧪 Playground Preview: https://element-plus.run/?pr=9466 |
Hi, maybe you need also to modify the test cases. |
Yes, making the sleep time 630 ms will fix it. I will do it soon. |
Updated times according to PR element-plus#9466
@holazz fixed the unit test issue, the current failed test does not seems to be related to this PR. Edit: It is related. Working on it. |
Updated times according to PR element-plus#9466
Now it should pass all tests 🧪 |
@holazz It is related to this PR. The up and down arrows are using repeat click directive in Time Picker which also registers single click as double clicks. |
You're right! I missed it.😅 |
@opuu Thank you for your contribution. After a little thought, I think a more reasonable way is not to increase the time interval of the long press trigger event, but to delay the trigger of the first event after the long press. I added a commit to this PR. What do you think? 2022-08-26.5.03.29.mov2022-08-26.5.14.31.mov |
Thats even better 👌 This way it will behave more like HTML input with number type. |
Please make sure these boxes are checked before submitting your PR, thank you!
dev
branch.The interval to detect long press (100ms) is too low, so single clicks are also being considered as repeat click.
For example: Clicking the plus or minus button of the
Input Number
component increases number by 2 instead of the defined step value (1).This PR fixes the Input Number component.