From cafc0a56b2630ab145fceeea4838b7914bbd8da1 Mon Sep 17 00:00:00 2001 From: xiamiao1121 <74885998+xiamiao1121@users.noreply.github.com> Date: Wed, 24 Jul 2024 17:25:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(dropdown):=20=E4=BF=AE=E5=A4=8Doverlay=3D{{?= =?UTF-8?q?className:=20'xx'}}=20=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#2934)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(dropdown): 修复overlay={{className: 'xx'}} 不生效问题(#2932) * chore(dropdown): 生成变更记录文件 * chore(dropdown): 删除无用console * chore(dropdown): 调整格式 --------- Co-authored-by: xiamiao --- .changeset/brown-poems-accept.md | 5 +++++ .changeset/quick-seas-allow.md | 5 +++++ packages/ui/dropdown/src/use-dropdown.tsx | 1 + 3 files changed, 11 insertions(+) create mode 100644 .changeset/brown-poems-accept.md create mode 100644 .changeset/quick-seas-allow.md diff --git a/.changeset/brown-poems-accept.md b/.changeset/brown-poems-accept.md new file mode 100644 index 000000000..3fd772063 --- /dev/null +++ b/.changeset/brown-poems-accept.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +fix(dropdown): 修复 overlay={{className: 'xx'}} 不生效问题 diff --git a/.changeset/quick-seas-allow.md b/.changeset/quick-seas-allow.md new file mode 100644 index 000000000..1c62b47d3 --- /dev/null +++ b/.changeset/quick-seas-allow.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/dropdown": patch +--- + +fix: 修复 overlay={{className: 'xx'}} 不生效问题 diff --git a/packages/ui/dropdown/src/use-dropdown.tsx b/packages/ui/dropdown/src/use-dropdown.tsx index d0849c4b1..6921878c5 100644 --- a/packages/ui/dropdown/src/use-dropdown.tsx +++ b/packages/ui/dropdown/src/use-dropdown.tsx @@ -134,6 +134,7 @@ export const useDropdown = (props: UseDropdownProps) => { overlay: { ...overlay, ...props.overlay, + className: props.overlay.className ?? overlay?.className, closeOnOutsideClick: true, visible: menuVisible, attachEl: triggerElementRef.current,