@@ -49,7 +49,6 @@ export default function DBInput(props: DBInputProps) {
49
49
_id : DEFAULT_ID ,
50
50
_isValid : undefined ,
51
51
_dataListId : DEFAULT_ID ,
52
- _value : '' ,
53
52
iconVisible : ( icon ?: string ) => {
54
53
return Boolean ( icon && icon !== '_' && icon !== 'none' ) ;
55
54
} ,
@@ -69,15 +68,15 @@ export default function DBInput(props: DBInputProps) {
69
68
props . change ( event ) ;
70
69
}
71
70
72
- // using controlled components for react forces us to using state for value
73
- state . _value = event . target . value ;
74
-
75
71
if ( event . target ?. validity ?. valid != state . _isValid ) {
76
72
state . _isValid = event . target ?. validity ?. valid ;
77
73
if ( props . validityChange ) {
78
74
props . validityChange ( ! ! event . target ?. validity ?. valid ) ;
79
75
}
80
76
}
77
+
78
+ // TODO: Replace this with the solution out of https://github.com/BuilderIO/mitosis/issues/833 after this has been "solved"
79
+ // VUE:this.$emit("update:value", event.target.value);
81
80
} ,
82
81
handleBlur : ( event : any ) => {
83
82
if ( props . onBlur ) {
@@ -108,10 +107,6 @@ export default function DBInput(props: DBInputProps) {
108
107
? props . dataListId
109
108
: `datalist-${ state . _id } ` ;
110
109
111
- if ( props . value ) {
112
- state . _value = props . value ;
113
- }
114
-
115
110
if ( props . stylePath ) {
116
111
state . stylePath = props . stylePath ;
117
112
}
@@ -138,7 +133,7 @@ export default function DBInput(props: DBInputProps) {
138
133
disabled = { props . disabled }
139
134
required = { props . required }
140
135
defaultValue = { props . defaultValue }
141
- value = { state . _value }
136
+ value = { props . value }
142
137
aria-invalid = { props . invalid }
143
138
maxLength = { props . maxLength }
144
139
minLength = { props . minLength }
0 commit comments