-
-
Notifications
You must be signed in to change notification settings - Fork 225
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(Dropdown): add Component Dropdown #1106
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🎊 PR Preview has been successfully built and deployed to https://zarm-preview-pr-1106.surge.sh |
Codecov Report
@@ Coverage Diff @@
## master #1106 +/- ##
==========================================
- Coverage 90.33% 90.19% -0.15%
==========================================
Files 237 240 +3
Lines 5245 5373 +128
Branches 1194 1265 +71
==========================================
+ Hits 4738 4846 +108
- Misses 497 517 +20
Partials 10 10
|
@JunIce |
还需要改进一下:
|
direction 重新赋值为 |
1.箭头方向反了,默认朝下 |
这样处理层级会有问题,内部的Picker组件的弹层就在Dropdown下面了。 |
@JeromeLin 看了一下仅靠生成节点的顺序可能还不行,现在popup不是强制destroy,会出现之前的节点被再次打开,所以会出现盖不住的情况 |
干脆限制只允许同时打开一个吧,把之前开的都关了 |
@JunIce 激活菜单的例子有点问题 |
packages/zarm/src/dropdown/demo.md
Outdated
| :--------------- | :-------------------- | :----- | :--------------------------- | | ||
| activeKey | number \| string | - | 激活的 Item Key | | ||
| defaultActiveKey | number \| string | - | 默认激活的 Item Key | | ||
| direction | 'up' \| 'down' | 'down' | 默认下拉方向 | |
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.
默认下拉方向 => 下拉方向
packages/zarm/src/dropdown/demo.md
Outdated
| animationType | string | - | 菜单动画类型,可选值 `fade`、`door`、`flip`、`rotate`、`zoom`、`zoom-fade`、`move-up`、 `move-down`、`move-left`、`move-right`、`slide-up`、`slide-down`、`slide-left`、`slide-right` | | ||
| animationDuration | number | - | 动画执行时间(单位:毫秒) | | ||
| popupClassName | string | - | 弹出层样式名 | | ||
| zIndex | number | - | 下拉层级,默认从1200开始累加 | |
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.
删除 zIndex 属性
interface CompoundedComponent | ||
extends React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<DropdownInstance>> { | ||
Item: typeof DropdownItem; | ||
_zIndex: number; |
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.
删除 zIndex 属性
@JunIce 默认激活 的示例有问题。 |
if (direction === 'down') { | ||
styleOffset.top = `${offset.current}px`; | ||
} else { | ||
styleOffset.bottom = `${offset.current}px`; | ||
styleOffset.height = `auto`; |
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.
resize/orientationchange 后,容器位置可以重新计算下
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.
ok
收到 |
#986