-
-
Notifications
You must be signed in to change notification settings - Fork 454
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: combobox prevent behavior #1042
Merged
afc163
merged 1 commit into
react-component:master
from
T-Roc:fix/combobox_prevent_behavior
May 7, 2024
Merged
fix: combobox prevent behavior #1042
afc163
merged 1 commit into
react-component:master
from
T-Roc:fix/combobox_prevent_behavior
May 7, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
测试用例覆盖一下 |
yoyo837
reviewed
May 3, 2024
我已经优化了代码写法,并添加了测试用例,麻烦帮忙看一下 |
测试用例挂了,看一下 |
这个错误升级 @testing-library/jest-dom ,testing-library/react 可以解决,我看到在 pr #1044 中做了处理还没合并到主分支,我这边要处理吗? |
我合并了 #1044 rebase 一下即可。 |
T-Roc
force-pushed
the
fix/combobox_prevent_behavior
branch
from
May 7, 2024 01:28
99f4309
to
5081e5e
Compare
T-Roc
force-pushed
the
fix/combobox_prevent_behavior
branch
from
May 7, 2024 01:48
5081e5e
to
5a30daf
Compare
处理好了 |
yoyo837
reviewed
May 7, 2024
it('should not prevent default behavior when mode is combobox and it is disabled', () => { | ||
const preventDefault = jest.fn(); | ||
const { container } = render( | ||
<Select mode="combobox" value="1" disabled> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
第二个用例测试单独的 disabled 吧
20 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
【原因】
issues 48281 反馈 AutoComplete 点击边缘,下拉框会跳动,经过排查发现是因为 rc-select 在 mode 为 combobox 的时候,没有禁止默认行为,导致内部 Input 会不断的失焦和聚焦,下拉会不断的展开和隐藏。
在源码中注释了,combobox 没有阻止默认行为的原因是为解决 issues 37320 即 combobox 禁用状态下,无法选中文字的问题
为了同时解决上面的问题,并且不影响原来的其他逻辑,我添加了禁用状态的限制条件