@@ -181,7 +181,7 @@ export class Input {
181
181
@Watch ( 'value' )
182
182
protected valueChanged ( ) {
183
183
const inputEl = this . nativeInput ;
184
- const value = this . value ;
184
+ const value = this . getValue ( ) ;
185
185
if ( inputEl && inputEl . value !== value ) {
186
186
inputEl . value = value ;
187
187
}
@@ -251,6 +251,10 @@ export class Input {
251
251
}
252
252
}
253
253
254
+ private getValue ( ) : string {
255
+ return this . value || '' ;
256
+ }
257
+
254
258
private emitStyle ( ) {
255
259
this . ionStyle . emit ( {
256
260
'interactive' : true ,
@@ -313,7 +317,7 @@ export class Input {
313
317
}
314
318
315
319
private hasValue ( ) : boolean {
316
- return this . value . length > 0 ;
320
+ return this . getValue ( ) . length > 0 ;
317
321
}
318
322
319
323
hostData ( ) {
@@ -329,7 +333,7 @@ export class Input {
329
333
}
330
334
331
335
render ( ) {
332
- renderHiddenInput ( this . el , this . name , this . value , this . disabled ) ;
336
+ renderHiddenInput ( this . el , this . name , this . getValue ( ) , this . disabled ) ;
333
337
334
338
return [
335
339
< input
@@ -358,7 +362,7 @@ export class Input {
358
362
step = { this . step }
359
363
size = { this . size }
360
364
type = { this . type }
361
- value = { this . value }
365
+ value = { this . getValue ( ) }
362
366
onInput = { this . onInput . bind ( this ) }
363
367
onBlur = { this . onBlur . bind ( this ) }
364
368
onFocus = { this . onFocus . bind ( this ) }
0 commit comments