mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-02 14:18:46 +02:00
Bootstrap classes for text field
Required to support new "compressed" form style in admin/assets which puts form field labels on their own line (and requires the bootstrap layout styling for this)
This commit is contained in:
parent
b4c5c71a0b
commit
7c62a6d58d
@ -23,7 +23,7 @@ class TextField extends SilverStripeComponent {
|
|||||||
|
|
||||||
// The extraClass property is defined on both the holder and element
|
// The extraClass property is defined on both the holder and element
|
||||||
// for legacy reasons (same behaviour as PHP rendering)
|
// for legacy reasons (same behaviour as PHP rendering)
|
||||||
const classNames = ['field', 'text', this.props.extraClass].join(' ');
|
const classNames = ['field', 'text', 'form-group', this.props.extraClass].join(' ');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames}>
|
<div className={classNames}>
|
||||||
@ -32,10 +32,8 @@ class TextField extends SilverStripeComponent {
|
|||||||
{labelText}
|
{labelText}
|
||||||
</label>
|
</label>
|
||||||
}
|
}
|
||||||
<div className="middleColumn">
|
|
||||||
{field}
|
{field}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +41,7 @@ class TextField extends SilverStripeComponent {
|
|||||||
return {
|
return {
|
||||||
// The extraClass property is defined on both the holder and element
|
// The extraClass property is defined on both the holder and element
|
||||||
// for legacy reasons (same behaviour as PHP rendering)
|
// for legacy reasons (same behaviour as PHP rendering)
|
||||||
className: ['text', this.props.extraClass].join(' '),
|
className: ['text', 'form-control', this.props.extraClass].join(' '),
|
||||||
id: `gallery_${this.props.name}`,
|
id: `gallery_${this.props.name}`,
|
||||||
name: this.props.name,
|
name: this.props.name,
|
||||||
onChange: this.handleChange,
|
onChange: this.handleChange,
|
||||||
|
Loading…
Reference in New Issue
Block a user