Search Issue Tracker
Fixed in 2017.2.0f3
Won't Fix in 5.4.X, 5.5.X, 2017.1.X
Votes
62
Found in
5.3.1f1
Issue ID
758761
Regression
No
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.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Android ] "AndroidJNI.ToBooleanArray" returns a random non-zero value instead of "IntPtr.Zero" when the method argument is null
- Non-HDR color picker opens when selecting material color with HDR enabled
- Crash on EditorApplication:Internal_CallUpdateFunctions when pushing property block by index to SpriteShapeRenderer
- Depth Texture Mode "After Opaques" breaks when "Full Screen Pass Renderer Feature" is added
- The Code Previews panel is initially opened in a slightly minimized state
LKWD_JamesD
Apr 03, 2017 12:25
Also affects iOS keyboard.
LKWD_JamesD
Apr 03, 2017 12:24
Can confirm issue is still present in Unity 5.4.5f1.
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.
Lightstream
Jan 19, 2017 14:01
And i'm using 5.5.0f3
Lightstream
Jan 19, 2017 14:01
And i'm using 5.5.0f3
Lightstream
Jan 19, 2017 14:00
I exactly have the same problems as described here :(
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.
holysexy
Nov 24, 2016 13:00
This is a very VERY BIG issue! i cant touch the screen without submit the InpufField !!!
tesan
Nov 21, 2016 16:00
it's a major bug i don't understand it still live ?
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.