Skip to content

Commit

Permalink
fix: #1293
Browse files Browse the repository at this point in the history
  • Loading branch information
Wugaoliang committed Nov 11, 2020
1 parent f683fe5 commit 9aacd37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
8 changes: 1 addition & 7 deletions components/form/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ const FormItem = (props) => {
obj['hi-form-item--validating'] = validating
obj['hi-form-item--required'] = isRequired() || required
const _labelWidth = labelWidth()
const contentWidth =
formProps.labelPosition !== 'top' && rectCont && rectCont.width ? rectCont.width - _labelWidth : '100%'
return (
<div className={classNames('hi-form-item', className, obj)} style={style} key={field} ref={FormItemContent}>
{label || label === '' ? (
Expand All @@ -317,11 +315,7 @@ const FormItem = (props) => {
) : (
<span className="hi-form-item__span" style={{ width: _labelWidth }} key={field + 'label'} />
)}
<div
className={'hi-form-item' + '__content'}
key={field + '__content'}
style={{ width: isNaN(contentWidth) ? '100%' : contentWidth }}
>
<div className={'hi-form-item' + '__content'} key={field + '__content'}>
<div className={'hi-form-item' + '__children'} style={{ alignItems: getItemPosition(contentPosition) }}>
{renderChildren()}
</div>
Expand Down
12 changes: 1 addition & 11 deletions docs/demo/form/section-align.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,8 @@ const code = [
}}
/>
</FormItem>
<FormItem label='手机号'>
<FormItem label='门店'>
<Select
data={[
{ title: '小米2', id: '2-1' },
{ title: '小米3', id: '2-2' },
{ title: '小米4', id: '2-3' },
{ title: '小米5', id: '2-4' },
{ title: '电脑', id: '3' },
{ title: '笔记本', id: '4' },
{ title: '生活周边', id: '5' },
{ title: '其它', id: '6' }
]}
dataSource={{
method: 'GET',
key: 'id',
Expand Down

0 comments on commit 9aacd37

Please sign in to comment.