Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11690] TiAPI: hideKeyboard method for view

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-04-14T23:13:18.000+0000
Affected Version/sn/a
Fix Version/s2014 Sprint 08, 2014 Sprint 08 SDK, Release 3.3.0
ComponentsTiAPI
Labelsmodule_api, qe-closed-3.3.0, qe-testadded, triage
ReporterMartin Guillon
AssigneeVishal Duggal
Created2012-10-10T09:00:46.000+0000
Updated2014-04-23T09:45:56.000+0000

Description

The title is quite explicit I should mention that on android it s hide the softkeyboard, which is quite obvious ....
var win = Titanium.UI.createWindow();
win.backgroundColor = '#ccc';

var textField = Ti.UI.createTextField({
	borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
  color: '#336699',
  width: 250, height: 60
});
win.add(textField);

win.addEventListener('click', function(e){
	if (e.source !== textField)
		win.hideKeyboard();
})

win.open();

Comments

  1. Martin Guillon 2012-10-10

    pull request https://github.com/appcelerator/titanium_mobile/pull/3147
  2. Ingo Muschenetz 2013-10-08

    Is there a reason you can't do textField.blur()?
  3. Martin Guillon 2013-10-09

    i would not have implemented it if it wasn't necessary ;) On example of use is when you have a login page with multiple textfields, or even a listview with textfields. Instead of keeping a reference to the current textfield, which is completely unnecessary, you can use this. Plus in a commonjs structure, one widget can not have any reference to the current textfield but might still want to make sure the keyboard gets hidden.
  4. Vishal Duggal 2014-04-14

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/5606
  5. Priya Agarwal 2014-04-23

    Verified with environment: Appc-Studio:3.3.0.201404211130 sdk:3.3.0.v20140422163054 acs:1.0.14 alloy:1.4.0-dev npm:1.3.2 titanium:3.3.0-dev titanium-code-processor:1.1.1-beta1 xCODE:5.1.1 Device:Iphone5s(7.1.1),LG-P970(v4.0.4) hideKeyboard method working well.

JSON Source