Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27512] Android: hideSoftKeyboard() not working as of 8.2.1

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2019-11-06T21:18:35.000+0000
Affected Version/sRelease 8.2.1
Fix Version/sRelease 8.3.0
ComponentsAndroid
Labelsandroid, engSchedule, escalation, keyboard, regression
ReporterRiduanul Islam
AssigneeGary Mathews
Created2019-10-30T12:38:09.000+0000
Updated2019-11-06T21:18:35.000+0000

Description

*Issue:* Soft Keyboard is not hiding using this method "Ti.UI.Android.hideSoftKeyboard()" on android version 8, 9 and 10. It works as expected with Ti SDK 8.2.0.GA but does not work with TI SDK 8.2.1.GA Please see the attached gif image. Same code using 8.2.1.GA left side, using 8.2.0.GA right side. *Steps to Reproduce:* 1. Run the following sample code on an android device or emulator. 2. Click on the textField for appearing keyboard. 3. Then click on the button for hiding it.
	var win = Ti.UI.createWindow({
		backgroundColor : 'white',
		layout : "vertical"
	});

	var textField = Ti.UI.createTextField({
		backgroundColor : '#fafafa',
		color : 'green',
		width : 250,
		top : 30,
		height : 40
	});

	// Create a Button.
	var test = Ti.UI.createButton({
		title : 'test',
		height : 50,
		width : 100,
		top : 30,

	});

	// Listen for click events.
	test.addEventListener('click', function() {
		Ti.UI.Android.hideSoftKeyboard();
	});

	win.add(textField);
	win.add(test);
	win.open();
*Expected Result:* It should hide the keyboard after clicking. *Work-Around:* Use the TextField object's blur() method instead. This still hides the keyboard in 8.2.1. However, it will also remove the focus from the TextField which might not be what you want.

Attachments

FileDateSize
hide.gif2019-10-30T12:23:59.000+0000316753

Comments

  1. Joshua Quick 2019-10-30

    I've confirmed that this regression was introduced as of Titanium 8.2.1. The hideSoftKeyboard() is removing the focus from the TextField, but keeps the virtual keyboard. It's doing the opposite of what it should be doing. It should be keeping the focus and dismissing the virtual keyboard instead.
  2. Gary Mathews 2019-10-31

    master: https://github.com/appcelerator/titanium_mobile/pull/11309
  3. Christopher Williams 2019-11-06

    merged to master
  4. Lokesh Choudhary 2019-11-06

    Verified the fix with SDK 8.3.0.v20191106103841. Closing.

JSON Source