# TextInput should handle null values.

**URL:** <https://forums.fusetools.com/t/textinput-should-handle-null-values/3722>\
**Category:** Feature Suggestions\
**Created:** [March 16, 2017, 9:08pm UTC](https://forums.fusetools.com/t/textinput-should-handle-null-values/3722 "2017-03-16T21:08:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitesh](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mitesh](https://forums.fusetools.com/u/mitesh)\
**Post date:** [March 16, 2017, 9:08pm UTC](https://forums.fusetools.com/t/textinput-should-handle-null-values/3722/1 "2017-03-16T21:08:04Z")

</div>

We have worked on several forms with Fuse and a common issue that we have faced is that when using Observables mapped to real data, we repeatedly have to check for null / undefined and set it to “” so that the TextInput actually updates to an empty string.

Consider the following code:

```auto
<App>
    <JavaScript>
        var Observable = require("FuseJS/Observable");

        var textValue = Observable();

        setTimeout(function() {
            console.log("Resetting text.");
            textValue.value = null;
        }, 10000);

        textValue.onValueChanged(function(val) {
            console.log("Text value changed: " + val);
        })

        module.exports = {
            textValue: textValue
        }
    </JavaScript>

    <TextInput Value="{textValue}" Background="#DDD"/>
</App>

```

If the app is launched and a user starts typing, 10 seconds later, the model value will reset to null but the TextInput will ignore that change and keep the stale string around.

When using / reusing a form where the parameter sets the initial values, not all fields will always have values. (For example, a user with firstName, lastName, email and optional phoneNumber).

Because of the “null” value not being accepted by the TextInput, a previous user’s phone number will stick around even after a parameter change.

My suggestion is to make the TextInput binding to an Observable with a null value behave just like an empty string. This would be similar functionality to Angular two-way binding, and I don’t believe such a change will negatively affect existing users or apps.
