Project: titanium
Issue TIMOB-6060: iOS: Blurring Textfield in Modal Window Doesn't Dismiss Keyboard
When using the MODAL_PRESENTATION_FORMSHEET modal style, iOS by default does not dismiss the keyboard even when text fields are blurred. iOS 4.3 and later allows us to override this, but this property is not currently exposed. This will be an iOS-only property on the Ti.UI.Window class, and will not apply to Android. In the mean time, MODAL_PRESENTATION_PAGESHEET is perfectly sufficient. (Not a bug, but leaving old comments) h1. Problem When blurring a text field in a modal window, the keyboard doesn't go away. h2. Reproduction Drop the following in an app.js, and click in the text field. It automatically blurs itself after gaining focus. If you change "modal: true" to "modal: false", the keyboard will properly hide itself. {code:title=app.js} var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var textField = Ti.UI.createTextField({ value: '1. Touch Me', height: 34, top: 10, left: 10, right: 10, borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED }); textField.addEventListener('focus', function () { Ti.API.info('blurring'); textField.blur(); Ti.API.info('blurred'); }); win.add(textField); win.open({ modal: true, modalStyle: Ti.UI.iPhone.MODAL_PRESENTATION_FORMSHEET }); {code}
Story points: 5