-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat: add maxCount to Popover.Menu #6373
Conversation
PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6373.surge.sh |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## feature #6373 +/- ##
===========================================
- Coverage 91.36% 91.33% -0.03%
===========================================
Files 310 310
Lines 6668 6670 +2
Branches 1657 1659 +2
===========================================
Hits 6092 6092
- Misses 540 542 +2
Partials 36 36
☔ View full report in Codecov by Sentry. |
@@ -42,9 +43,20 @@ export const PopoverMenu = forwardRef<PopoverRef, PopoverMenuProps>( | |||
) | |||
|
|||
const overlay = useMemo(() => { | |||
const whetherScroll = | |||
props?.maxCount && props.actions.length > props?.maxCount | |||
const innerHeight = props?.maxCount && props?.maxCount * 48 |
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.
略黑,看看能不能用 calc 算出来?
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.
实不相瞒item 的盒模型是我人工计算出的48
然后应该是这里的结构嵌套问题,然后初次渲染时拿不到dom,通过api获取不了overlay 里 item 的 height
#6360
48 为每个 item 的高度