fix: Typography demo Interactive (#25908)

This commit is contained in:
zhangchen 2020-07-30 16:54:49 +08:00 committed by GitHub
parent b9db9cd79f
commit 2f99dd8c19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 20 deletions

View File

@ -326,7 +326,7 @@ Array [
exports[`renders ./components/typography/demo/interactive.md correctly 1`] = ` exports[`renders ./components/typography/demo/interactive.md correctly 1`] = `
Array [ Array [
<span <div
class="ant-typography" class="ant-typography"
> >
This is an editable text. This is an editable text.
@ -358,9 +358,8 @@ Array [
</svg> </svg>
</span> </span>
</div> </div>
</span>, </div>,
<br />, <div
<span
class="ant-typography" class="ant-typography"
> >
This is a copyable text. This is a copyable text.
@ -392,9 +391,8 @@ Array [
</svg> </svg>
</span> </span>
</div> </div>
</span>, </div>,
<br />, <div
<span
class="ant-typography" class="ant-typography"
> >
Replace copy text. Replace copy text.
@ -426,9 +424,8 @@ Array [
</svg> </svg>
</span> </span>
</div> </div>
</span>, </div>,
<br />, <div
<span
class="ant-typography" class="ant-typography"
> >
Custom icon. Custom icon.
@ -460,7 +457,7 @@ Array [
</svg> </svg>
</span> </span>
</div> </div>
</span>, </div>,
<div <div
class="ant-typography" class="ant-typography"
> >

View File

@ -17,7 +17,7 @@ Provide additional interactive capacity of editable and copyable.
import { Typography } from 'antd'; import { Typography } from 'antd';
import { SmileOutlined } from '@ant-design/icons'; import { SmileOutlined } from '@ant-design/icons';
const { Text, Paragraph } = Typography; const { Paragraph } = Typography;
class Demo extends React.Component { class Demo extends React.Component {
state = { state = {
@ -32,13 +32,10 @@ class Demo extends React.Component {
render() { render() {
return ( return (
<> <>
<Text editable={{ onChange: this.onChange }}>{this.state.str}</Text> <Paragraph editable={{ onChange: this.onChange }}>{this.state.str}</Paragraph>
<br /> <Paragraph copyable>This is a copyable text.</Paragraph>
<Text copyable>This is a copyable text.</Text> <Paragraph copyable={{ text: 'Hello, Ant Design!' }}>Replace copy text.</Paragraph>
<br /> <Paragraph copyable={{ icon: <SmileOutlined /> }}>Custom icon.</Paragraph>
<Text copyable={{ text: 'Hello, Ant Design!' }}>Replace copy text.</Text>
<br />
<Text copyable={{ icon: <SmileOutlined /> }}>Custom icon.</Text>
<Paragraph copyable={{ tooltips: ['click here', 'you clicked!!'] }}> <Paragraph copyable={{ tooltips: ['click here', 'you clicked!!'] }}>
Replace tooltips text. Replace tooltips text.
</Paragraph> </Paragraph>

View File

@ -159,7 +159,7 @@
left: -@input-padding-horizontal - 1px; left: -@input-padding-horizontal - 1px;
margin-top: -@input-padding-vertical-base - 1px; margin-top: -@input-padding-vertical-base - 1px;
// stylelint-disable-next-line function-calc-no-invalid // stylelint-disable-next-line function-calc-no-invalid
margin-bottom: calc(1em - @input-padding-vertical-base - 2px); margin-bottom: calc(1em - @input-padding-vertical-base - 1px);
} }
&-confirm { &-confirm {