[TIMOB-11690] TiAPI: hideKeyboard method for view
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-04-14T23:13:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2014 Sprint 08, 2014 Sprint 08 SDK, Release 3.3.0 |
Components | TiAPI |
Labels | module_api, qe-closed-3.3.0, qe-testadded, triage |
Reporter | Martin Guillon |
Assignee | Vishal Duggal |
Created | 2012-10-10T09:00:46.000+0000 |
Updated | 2014-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();
pull request https://github.com/appcelerator/titanium_mobile/pull/3147
Is there a reason you can't do textField.blur()?
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.
Pull pending https://github.com/appcelerator/titanium_mobile/pull/5606
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.