Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard doesn't clear out last character from KeyboardInputField #917

Closed
jburfield92 opened this issue Aug 31, 2017 · 2 comments
Closed

Comments

@jburfield92
Copy link

I have a textbox with the KeyboardInputField script on it with the Keyboard prefab in the scene.

When I tap in the textbox and start inputting characters and then decide to backspace until the textbox is cleared out, the last character (which is the first character inputted) is not cleared from the textbox. Although, The textbox in the Keyboard prefab is cleared entirely. When I add a new character, it replaces the uncleared character from the textbox.

I was able to resolve the problem by removing the if statement from the following code in KeyboardInputField:

private void Keyboard_onTextUpdated(string newText)
{
    if (!string.IsNullOrEmpty(newText))
    {
        this.text = newText;
    }
}  
@jasonhbartlett
Copy link

jasonhbartlett commented Dec 6, 2017

I don't know if this is the fix but I was able to deal with it by replacing that with:

private void Keyboard_OnTextUpdated(string newText)
        {
            text = Keyboard.Instance.InputField.text;
            //if (!string.IsNullOrEmpty(newText))
            //{
            //    text = newText;
            //}
        }

Of course that makes the parameter newText obsolete, but...

@david-c-kline
Copy link

This was released in the 2017.4.0.0 release candidate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants