Search Issue Tracker

Fixed in 2017.2.0f3

Won't Fix in 5.4.X, 5.5.X, 2017.1.X



Found in


Issue ID




When pressing outside the touchscreen keyboard on Android devices, wasCanceled state is false



It is impossible to distinguish between pressing "DONE"/"OK" on the touchscreen keyboard and pressing outside the keyboard area on Android devices. Pressing outside the keyboard is an indication of the user wanting to cancel.

Reproduction steps:
1. Open the attached project
2. Build on Android device
3. Press outside the touchscreen keyboard
4. Notice that the canceled state is false

Note: When clicking the back button canceled state is true, but the done state is also true.

Fixed in: 2017.2.0b2
Introduced new API: TouchScreenKeyboard.status which returns an enum (Visible, Done, Canceled, LostFocus) for keyboard actions.

Comments (33)

  1. LKWD_JamesD

    Apr 03, 2017 12:25

    Also affects iOS keyboard.

  2. LKWD_JamesD

    Apr 03, 2017 12:24

    Can confirm issue is still present in Unity 5.4.5f1.

  3. Mohammad-Faisal-Aleem

    Feb 24, 2017 21:15

    This is happening on iOS as well. I am frustrated to see this. This should be something which we can control or we should be exposed a setting to enable disable this feature.

  4. Lightstream

    Jan 19, 2017 14:01

    And i'm using 5.5.0f3

  5. Lightstream

    Jan 19, 2017 14:01

    And i'm using 5.5.0f3

  6. Lightstream

    Jan 19, 2017 14:00

    I exactly have the same problems as described here :(

  7. CameronGoosen

    Dec 13, 2016 18:50

    Trying to build around this issue created so many problems and was very frustrating, I highly recommend that it gets addressed.

  8. holysexy

    Nov 24, 2016 13:00

    This is a very VERY BIG issue! i cant touch the screen without submit the InpufField !!!

  9. tesan

    Nov 21, 2016 16:00

    it's a major bug i don't understand it still live ?

  10. DurbsDev

    Sep 20, 2016 09:55

    This is a severe limiting factor in Unity3D for iOS and Android. On many situations the app needs to differentiate between tapping away from the keyboard and tapping the ok/done button. The current TouchScreenKeyboard has no way to differentiate this.

    An example is for the app to be able to automatically advance to the next text capture field when pressing ok/done, but to not do this when tapping away from the keyboard.

    Another example is in a chat app where pressing ok/cancel will send the chat message but tapping away from the keyboard should just keep the chat message but not send it.

    The current usage of wasCancelled is actually currently correct: wasCancelled should only be true when the user taps on the Cancel button on the keyboard (Back button on the Android keyboard). It should not be set to true when the user taps away from the keyboard.

    What is required is another field: wasTappedOutside. This would be set to true when the user taps outside the keyboard. TouchScreenKeyboard.done and TouchScreenKeyboard.wasCancelled can remain exactly as they are and preserve perfect backwards compatibility with existing apps. In this way the fix will bring great and immediate benefit with no risk.

    In desperation, many developers including myself have tried to modify or subclass UI.InputField (source is provided for this), and have had some joy on Desktop/Editor, emulating OK/Done with the Enter key and clicking away from an InputField, but have come to a sticky end on mobile when they realise InputField is entirely dependant on the TouchScreenKeyboard.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.