# several issues with TextInput on devices

**URL:** <https://forums.fusetools.com/t/several-issues-with-textinput-on-devices/3726>\
**Category:** Bug Reports\
**Created:** [July 12, 2016, 6:51am UTC](https://forums.fusetools.com/t/several-issues-with-textinput-on-devices/3726 "2016-07-12T06:51:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [July 12, 2016, 6:51am UTC](https://forums.fusetools.com/t/several-issues-with-textinput-on-devices/3726/1 "2016-07-12T06:51:04Z")

</div>

Hey, testing with latest production and pre-release Fuse builds (6650, 6853), OSX. Issues only visible on devices, both running preview and production builds of the app.

Testcase:

```auto
<App>

    <TextInput ux:Name="MyInput" IsPassword="true" Height="50" Background="#88b" TextColor="#fff" HitTestMode="LocalBoundsAndChildren">
        <Panel Width="50" Dock="Right" HitTestMode="LocalBoundsAndChildren">
            <Text Alignment="Center" Value="Show" Color="#fff" />
            <Clicked>
                <Toggle Target="ShowPassword" />
            </Clicked>
        </Panel>
        <Clicked>
            <GiveFocus Target="MyInput" />
        </Clicked>
        <WhileTrue ux:Name="ShowPassword" Value="false">
            <Change MyInput.IsPassword="false" />
        </WhileTrue>
    </TextInput>

</App>

```

1. iOS: when entering some text inside the `TextInput`, and then clicking the “Show” `Panel`, the `IsPassword` is being correctly set to true/false, however, the fonts are changed to a different typeface that looks like Times New Roman ([https://www.dropbox.com/s/vap6sr4ytzngza9/Screenshot%202016-07-12%2009.47.03.png?dl=0](https://www.dropbox.com/s/vap6sr4ytzngza9/Screenshot%202016-07-12%2009.47.03.png?dl=0)). In addition to that, the caret is indented so as if there was a Tab or multiple spaces behind the entered string, although there clearly isn’t anything. This issue is also present on iOS simulators.

2. Android: when repeatedly clicking the “Show” `Panel`, the caret gets put at the beginning of the entered string, while it should be left at the end. Applies both to when `IsPassword` is set to true and false.

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [July 12, 2016, 1:51pm UTC](https://forums.fusetools.com/t/several-issues-with-textinput-on-devices/3726/2 "2016-07-12T13:51:41Z")

</div>

Thanks for reporting, an internal issue have been created!

---

<div class="post-metadata">

**Author:** ![Vegard\_Strand\_Lende](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/vegard_strand_lende/32/349_2.png) [@Vegard\_Strand\_Lende](https://forums.fusetools.com/u/Vegard_Strand_Lende)\
**Post date:** [July 18, 2016, 2:53pm UTC](https://forums.fusetools.com/t/several-issues-with-textinput-on-devices/3726/3 "2016-07-18T14:53:46Z")

</div>

Toggeling `IsPassword` while editing text on iOS causes the TextInputs value to be cleard when going from `IsPassword="false"` to `IsPassword="true"`. That behavior is the default in iOS and cannot be turned off without hacks in the inputhandling.

Maybe you should try another approach for making the Show Password feature (toggeling visibility on a `<TextInput IsPassword="false" />` and `<TextInput IsPassword="true" />`.

The other issues will be fixed.

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [July 19, 2016, 7:15am UTC](https://forums.fusetools.com/t/several-issues-with-textinput-on-devices/3726/4 "2016-07-19T07:15:37Z")

</div>

Hey @vegard, thanks for the reply!

I understand that the suggestion to use two `TextInput`s is to avoid the issue of caret being put in front of the entered content on iOS. That’s a really minor thing if the rest is fixed - especially the changing font face and weird indent.

Thing is, using two `TextInput`s for a single entity (password in this case) becomes somewhat complicated when you need to refer to them by `ux:Name` for example. Also, I haven’t tested this, but I suspect the suggested approach may have an undesired effect on the default focusing order upon `TextInputActionTriggered`.

I will for now run with this but a more simple alternative would be nice; that being said, the caret-at-the-front on iOS for a single edge case is not really a problem.

---

<div class="post-metadata">

**Author:** ![Vegard\_Strand\_Lende](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/vegard_strand_lende/32/349_2.png) [@Vegard\_Strand\_Lende](https://forums.fusetools.com/u/Vegard_Strand_Lende)\
**Post date:** [July 19, 2016, 7:28am UTC](https://forums.fusetools.com/t/several-issues-with-textinput-on-devices/3726/5 "2016-07-19T07:28:09Z")

</div>

On second thoughts, I think the two textinputs approach might end up with the same problems on iOS when just toggeling `IsPassword`. Because the auto clear of the password happens if the `IsPassword="true"` textinput loses and gains focus. Which would happen if switching between two textinputs.

I think the easiest might be to just implement a native textinput with the workaround for the autoclear behavior.

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [July 19, 2016, 7:50am UTC](https://forums.fusetools.com/t/several-issues-with-textinput-on-devices/3726/6 "2016-07-19T07:50:49Z")

</div>

> **Vegard Strand Lende wrote:**
> 
> […] implement a native textinput with the workaround for the autoclear behavior.

Any hints on the direction to do this right?

---

<div class="post-metadata">

**Author:** ![Vegard\_Strand\_Lende](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/vegard_strand_lende/32/349_2.png) [@Vegard\_Strand\_Lende](https://forums.fusetools.com/u/Vegard_Strand_Lende)\
**Post date:** [July 19, 2016, 9:40am UTC](https://forums.fusetools.com/t/several-issues-with-textinput-on-devices/3726/7 "2016-07-19T09:40:52Z")

</div>

Implementing a `UITextField` subclass in ObjC and use that from foreign code. I realize that it might become tedious to do. Im gonna try to find some time this week to see if I can make a solution
