From 4ee0b8ff49dd6fc6effbd617228496b9e2f5156f Mon Sep 17 00:00:00 2001 From: xiamiao1121 <74885998+xiamiao1121@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:31:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(drawer):=20=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89zIndex=E5=8A=9F=E8=83=BD=20(#2851)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(drawer): 支持自定义zIndex功能(#2850) * chore(drawer): 生成变更记录文件 * chore: 修改container类型 --------- Co-authored-by: xiamiao --- .changeset/strong-dragons-ring.md | 5 +++++ .changeset/yellow-bats-argue.md | 5 +++++ packages/ui/drawer/src/Drawer.tsx | 6 +++++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changeset/strong-dragons-ring.md create mode 100644 .changeset/yellow-bats-argue.md diff --git a/.changeset/strong-dragons-ring.md b/.changeset/strong-dragons-ring.md new file mode 100644 index 000000000..d9f3dabeb --- /dev/null +++ b/.changeset/strong-dragons-ring.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/drawer": minor +--- + +feat: 支持自定义 zIndex 功能 diff --git a/.changeset/yellow-bats-argue.md b/.changeset/yellow-bats-argue.md new file mode 100644 index 000000000..ae1c31ae9 --- /dev/null +++ b/.changeset/yellow-bats-argue.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +feat(drawer): 支持自定义 zIndex 功能 diff --git a/packages/ui/drawer/src/Drawer.tsx b/packages/ui/drawer/src/Drawer.tsx index 3ccc25767..a0431dc87 100644 --- a/packages/ui/drawer/src/Drawer.tsx +++ b/packages/ui/drawer/src/Drawer.tsx @@ -167,6 +167,10 @@ export interface DrawerProps extends Omit, 'title'>, UseM * 自定义抽屉高度,仅在 placement="bottom" | "top" 有效 */ height?: number + /** + * 自定义css展示层级 + */ + zIndex?: number /** * 开启预加载渲染,用于性能优化,优先级小于 `unmountOnClose` */ @@ -182,7 +186,7 @@ export interface DrawerProps extends Omit, 'title'>, UseM /** * 指定 portal 的容器 */ - container?: HTMLElement + container?: HTMLElement | null /** * 设置唤起的方向 */