From c35787696ba4133d4a2fac2c76ed0a2cdcc0f756 Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Sat, 7 Jan 2023 23:24:27 +0800 Subject: [PATCH] demo: update demo (#40079) * demo: update demo * rerun ci --- .../__snapshots__/demo-extend.test.ts.snap | 27 +++++++++++++++++++ .../__tests__/__snapshots__/demo.test.ts.snap | 27 +++++++++++++++++++ components/button/button.tsx | 2 +- components/button/demo/block.tsx | 6 +++++ components/tooltip/index.tsx | 2 +- 5 files changed, 62 insertions(+), 2 deletions(-) diff --git a/components/button/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/button/__tests__/__snapshots__/demo-extend.test.ts.snap index dc6ab5dbae..858707b9d3 100644 --- a/components/button/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/button/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -117,6 +117,33 @@ exports[`renders ./components/button/demo/block.tsx extend context correctly 1`] +
+ +
+
+ +
diff --git a/components/button/__tests__/__snapshots__/demo.test.ts.snap b/components/button/__tests__/__snapshots__/demo.test.ts.snap index 469205ee35..f31ae06ee2 100644 --- a/components/button/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/button/__tests__/__snapshots__/demo.test.ts.snap @@ -117,6 +117,33 @@ exports[`renders ./components/button/demo/block.tsx correctly 1`] = `
+
+ +
+
+ +
diff --git a/components/button/button.tsx b/components/button/button.tsx index 60c4dd3ca8..ac9daec04c 100644 --- a/components/button/button.tsx +++ b/components/button/button.tsx @@ -160,7 +160,7 @@ const InternalButton: React.ForwardRefRenderFunction< block = false, /** If we extract items here, we don't need use omit.js */ // React does not recognize the `htmlType` prop on a DOM element. Here we pick it out of `rest`. - htmlType = 'button' as ButtonProps['htmlType'], + htmlType = 'button', ...rest } = props; diff --git a/components/button/demo/block.tsx b/components/button/demo/block.tsx index 89d9a2136f..4a9ed7ee3d 100644 --- a/components/button/demo/block.tsx +++ b/components/button/demo/block.tsx @@ -10,6 +10,12 @@ const App: React.FC = () => ( + + diff --git a/components/tooltip/index.tsx b/components/tooltip/index.tsx index 0ee7ec06a1..4071638fed 100644 --- a/components/tooltip/index.tsx +++ b/components/tooltip/index.tsx @@ -237,7 +237,7 @@ const Tooltip = React.forwardRef((props, ref) => { // 根据当前坐标设置动画点 const rect = domNode.getBoundingClientRect(); - const transformOrigin = { top: '50%', left: '50%' }; + const transformOrigin: React.CSSProperties = { top: '50%', left: '50%' }; if (/top|Bottom/.test(placement)) { transformOrigin.top = `${rect.height - align.offset![1]}px`;