demo: update demo (#40079)

* demo: update demo

* rerun ci
This commit is contained in:
lijianan 2023-01-07 23:24:27 +08:00 committed by GitHub
parent 0086884179
commit c35787696b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 62 additions and 2 deletions

View File

@ -117,6 +117,33 @@ exports[`renders ./components/button/demo/block.tsx extend context correctly 1`]
</span>
</button>
</div>
<div
class="ant-space-item"
style="margin-bottom:8px"
>
<button
class="ant-btn ant-btn-default ant-btn-block"
disabled=""
type="button"
>
<span>
disabled
</span>
</button>
</div>
<div
class="ant-space-item"
style="margin-bottom:8px"
>
<button
class="ant-btn ant-btn-text ant-btn-block"
type="button"
>
<span>
text
</span>
</button>
</div>
<div
class="ant-space-item"
>

View File

@ -117,6 +117,33 @@ exports[`renders ./components/button/demo/block.tsx correctly 1`] = `
</span>
</button>
</div>
<div
class="ant-space-item"
style="margin-bottom:8px"
>
<button
class="ant-btn ant-btn-default ant-btn-block"
disabled=""
type="button"
>
<span>
disabled
</span>
</button>
</div>
<div
class="ant-space-item"
style="margin-bottom:8px"
>
<button
class="ant-btn ant-btn-text ant-btn-block"
type="button"
>
<span>
text
</span>
</button>
</div>
<div
class="ant-space-item"
>

View File

@ -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;

View File

@ -10,6 +10,12 @@ const App: React.FC = () => (
<Button type="dashed" block>
Dashed
</Button>
<Button disabled block>
disabled
</Button>
<Button type="text" block>
text
</Button>
<Button type="link" block>
Link
</Button>

View File

@ -237,7 +237,7 @@ const Tooltip = React.forwardRef<unknown, TooltipProps>((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`;