-
-
Notifications
You must be signed in to change notification settings - Fork 478
fix: dropdownMatchSelectWidth={false} not disable virtual #699
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
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/react-component/select/DV222PDD2ojY8XHvLtdRidxpkCdD |
const selectContext = React.useMemo( | ||
() => ({ | ||
const selectContext = React.useMemo(() => { | ||
const realVirtual = virtual !== false && dropdownMatchSelectWidth !== false; |
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.
47ede42
to
0f16085
Compare
expect(wrapper.find('.rc-select-dropdown').last().props().style.minWidth).toBe(1000); | ||
|
||
// dropdownMatchSelectWidth is false means close virtual scroll | ||
expect(wrapper.find('.rc-select-item')).toHaveLength(options.length); |
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.
这句断言在 jsdom 里测不出来,即使开启虚拟滚动 length 也始终是全量。
Codecov Report
@@ Coverage Diff @@
## master #699 +/- ##
=======================================
Coverage 99.50% 99.50%
=======================================
Files 25 25
Lines 1011 1012 +1
Branches 320 321 +1
=======================================
+ Hits 1006 1007 +1
Misses 4 4
Partials 1 1
Continue to review full report at Codecov.
|
|
||
// dropdownMatchSelectWidth is false means close virtual scroll | ||
expect(wrapper.find('.rc-select-item')).toHaveLength(options.length); | ||
expect((wrapper.find(VirtualList).props() as any).virtual).toBe(false); |
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.
还是要检查传给 VirtualList 的属性。
close ant-design/ant-design#33495