fix: Input with suffix align issue (#22603)

* fix: Input prefix style

* update snapshot

* fix int
This commit is contained in:
二货机器人 2020-03-25 22:44:56 +08:00 committed by GitHub
parent fbdfd4afc0
commit e95603b599
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 0 deletions

View File

@ -890,6 +890,42 @@ exports[`renders ./components/input/demo/align.md correctly 1`] = `
</span>
</span>
</span>
<span
class="ant-input-affix-wrapper"
style="width:50px"
>
<input
class="ant-input"
type="text"
value=""
/>
<span
class="ant-input-suffix"
>
Y
</span>
</span>
<input
class="ant-input"
style="width:50px"
type="text"
value=""
/>
<span
class="ant-input-affix-wrapper"
style="width:50px"
>
<input
class="ant-input"
type="text"
value="1"
/>
<span
class="ant-input-suffix"
>
Y
</span>
</span>
</div>
`;

View File

@ -28,6 +28,10 @@ const RadioGroup = Radio.Group;
const Option = Select.Option;
const { MonthPicker, RangePicker } = DatePicker;
const narrowStyle = {
width: 50,
};
const options = [
{
value: 'zhejiang',
@ -94,6 +98,9 @@ ReactDOM.render(
<AutoComplete style={{ width: 100 }} placeholder="input here" />
<br />
<Input prefix="$" addonBefore="Http://" addonAfter=".com" defaultValue="mysite" />
<Input style={narrowStyle} suffix="Y" />
<Input style={narrowStyle} />
<Input style={narrowStyle} defaultValue="1" suffix="Y" />
</div>,
mountNode,
);

View File

@ -17,6 +17,12 @@
box-shadow: none;
}
}
&::before {
width: 0;
visibility: hidden;
content: '\a0';
}
}
&-prefix,