-
-
Notifications
You must be signed in to change notification settings - Fork 241
fix: 容器可视宽度低于整体宽度进行切换时,下拉菜单无法显示隐藏的内容 #697
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
f3a1241
52e23e7
2f526f7
6511de9
43aafe5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ export default function useVisibleRange( | |
tabContentSizeValue: number, | ||
addNodeSizeValue: number, | ||
operationNodeSizeValue: number, | ||
containerExcludeExtraSizeValue: number, | ||
activeKey: string, | ||
{ tabs, tabPosition, rtl }: { tabs: Tab[] } & TabNavListProps, | ||
): [visibleStart: number, visibleEnd: number] { | ||
let charUnit: 'width' | 'height'; | ||
|
@@ -34,6 +36,16 @@ export default function useVisibleRange( | |
return [0, 0]; | ||
} | ||
|
||
if (containerExcludeExtraSizeValue < tabContentSizeValue) { | ||
let filterIndex | ||
tabs.forEach((item, index) => { | ||
if ((item.tabKey || item.key) === activeKey) { | ||
filterIndex = index | ||
} | ||
}) | ||
return [filterIndex, filterIndex] | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 能帮忙补一个测试用例不? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 我看overflow.test.tsx中的should calculate hidden tabs correctly用例应该可以覆盖这种情况吧 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 那为啥原来的测试用例没挂呢? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 那我试着补一个 |
||
|
||
const len = tabs.length; | ||
let endIndex = len; | ||
for (let i = 0; i < len; i += 1) { | ||
|
Uh oh!
There was an error while loading. Please reload this page.