Skip to content

Commit

Permalink
fix: antd select should not have max-width by default (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
stkevintan authored and janryWang committed Jun 16, 2019
1 parent 7923e91 commit b4a494a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion docs/Examples/antd/Detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const App = () => {
{ label: '选项4', value: '4' }
]}
required
x-props={{ style: { maxWidth: 300 } }}
title="Select单选"
name="select"
/>
Expand All @@ -82,7 +83,7 @@ const App = () => {
]}
required
title="Select多选"
x-props={{ multiple: true }}
x-props={{ multiple: true, style: { maxWidth: 300 } }}
name="multiselect"
/>
<Field
Expand Down
2 changes: 2 additions & 0 deletions docs/Examples/antd/International.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ReactDOM.render(
type="string"
enum={['1', '2', '3', '4']}
required
x-props={{ style: { maxWidth: 300 } }}
title="Select"
name="select"
/>
Expand Down Expand Up @@ -122,6 +123,7 @@ ReactDOM.render(
type="string"
enum={['1', '2', '3', '4']}
required
x-props={{ style: { maxWidth: 300 } }}
title="Select"
name="select"
/>
Expand Down
2 changes: 1 addition & 1 deletion docs/Examples/antd/Relations.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const App = () => {
title="GG"
x-props={{ showSearch: true, filterLocal: false }}
/>
<Field name="hh" type="string" title="HH" enum={[]} />
<Field name="hh" type="string" title="HH" enum={[]} x-props={{ style: { maxWidth: 300 } }} />
{state.visible && <Field name="mm" type="string" title="MM" />}
</FormBlock>
<FormButtonGroup offset={6}>
Expand Down
1 change: 1 addition & 0 deletions docs/Examples/antd/Sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ ReactDOM.render(
required
title="Select"
name="select"
x-props={{ style: { maxWidth: 300 } }}
/>
<Field
type="checkbox"
Expand Down
7 changes: 4 additions & 3 deletions packages/antd/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const WrapSelect = styled(
}
}
)`
min-width: 200px;
max-width: 300px;
width: 100%;
`

const Text = styled(props => {
Expand All @@ -41,7 +40,9 @@ const Text = styled(props => {
} else {
value = Array.isArray(props.value)
? props.value.join(' ~ ')
: String(props.value === undefined || props.value === null ? '' : props.value)
: String(
props.value === undefined || props.value === null ? '' : props.value
)
}
return (
<div className={`${props.className} ${props.size || ''} text-field`}>
Expand Down

0 comments on commit b4a494a

Please sign in to comment.