Skip to content
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

Merged
merged 3 commits into from
Oct 16, 2023

Conversation

1587315093
Copy link
Contributor

#6360

48 为每个 item 的高度

@github-actions
Copy link
Contributor

PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6373.surge.sh

@zombieJ
Copy link
Member

zombieJ commented Sep 22, 2023

这个看不出来可以滚动...

截屏2023-09-22 14 51 29

@1587315093
Copy link
Contributor Author

加了个这样的箭头咋样

image

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (30b6b84) 91.36% compared to head (0f0cd69) 91.33%.

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              
Files Coverage Δ
src/components/popover/popover.tsx 92.85% <ø> (ø)
src/components/popover/popover-menu.tsx 17.85% <0.00%> (-1.38%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

略黑,看看能不能用 calc 算出来?

Copy link
Contributor Author

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

@1587315093 1587315093 merged commit 969837b into ant-design:feature Oct 16, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants