Skip to content

Commit 4d5240a

Browse files
committed
add margins support to TextField
1 parent 93e8655 commit 4d5240a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/inputs/BaseInput.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export default class BaseInput extends BaseComponent {
6767
super(props);
6868

6969
this.state = {
70+
...this.state,
7071
value: props.value,
7172
focused: false,
7273
valid: false,

src/components/inputs/TextField.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export default class TextField extends BaseInput {
157157
this.toggleExpandableModal = this.toggleExpandableModal.bind(this);
158158

159159
this.state = {
160+
...this.state,
160161
value: props.value, // for floatingPlaceholder functionality
161162
floatingPlaceholderState: new Animated.Value(this.shouldFloatPlaceholder(props.value) ? 1 : 0),
162163
showExpandableModal: false
@@ -553,11 +554,12 @@ export default class TextField extends BaseInput {
553554
}
554555

555556
render() {
557+
const {margins} = this.state;
556558
const {expandable, containerStyle, underlineColor, useTopErrors, hideUnderline} = this.getThemeProps();
557559
const underlineStateColor = this.getStateColor(underlineColor, true);
558560

559561
return (
560-
<View style={[this.styles.container, containerStyle]} collapsable={false}>
562+
<View style={[this.styles.container, margins, containerStyle]} collapsable={false}>
561563
{this.shouldShowTopError() ? this.renderError(useTopErrors) : this.renderTitle()}
562564

563565
<View

0 commit comments

Comments
 (0)