Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11561] keyboardToolbar of textField not being displayed on textField.focus()

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-10-31T00:04:29.000+0000
Affected Version/sRelease 2.1.3
Fix Version/sRelease 2.1.4, Release 3.0.0, Release 3.1.0, 2012 Sprint 22 API, 2012 Sprint 22
ComponentsiOS
Labelsapi, developer-preview, module_textfield, qe-testadded, regression
ReporterAmuktha Akkinepally
AssigneeVishal Duggal
Created2012-10-23T23:17:55.000+0000
Updated2013-10-04T07:22:26.000+0000

Description

The Keyboard Toolbar on top of the key board does not appear once the textField is blurred and then re focussed. This works fine on 2.1.0, 2.1.1, 2.1.2 GAs.

Steps to reproduce:

1. Load the app with below app.js 2. Make sure the app on Ti SDK 2.1.3GA 3. Enter a value greater than 10. 4. Click on the 'button' Actual Result: The Keyboard toolbar just disappears. Expected Result: The Keyboard toolbar should not disappear like on 2.1.2 SDK. app.js:
var  win = Titanium.UI.createWindow({
                    backgroundColor:'white',
                    title:'window',
                    barColor:'#ff7b01',
                    top:0
                });

var b = Titanium.UI.createButton({
        title:'Button',
        style:Titanium.UI.iPhone.SystemButtonStyle.DONE
    });
    b.addEventListener('click',function(){
        txtField.blur();
    })
    var flexSpace = Titanium.UI.createButton({
        systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
    });
var txtField = Titanium.UI.createTextField({
            color : '#ff7c00',
            font : {
                fontSize : 16,
                fontWeight : 'bold',
                fontFamily : 'Helvetica Neue'
            },
            top : 19,
            textAlign : 'right',
            height : 50,
            left:'65%',
            right : '10%',
            keyboardType : Titanium.UI.KEYBOARD_NUMBER_PAD,
            returnKeyType : Titanium.UI.RETURNKEY_DEFAULT,
            borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
            keyboardToolbarColor:'#898989',
            keyboardToolbar:[flexSpace,b,flexSpace]
        });
txtField.addEventListener('blur',function(e){
    if(e.value > 10){
        txtField.value = '';
        /*setTimeout(function(){
            txtField.focus()},1000)*/
        txtField.focus();
    }

})

win.add(txtField);


win.open()

Comments

  1. Vishal Duggal 2012-10-24

    Focusing inside blur events and blurring inside focus events is a really bad design so no we will not fix race conditions. Anyways from what I can see of the app, the whole value verification can be done on the click listener of the button.
  2. Blain Hamon 2012-10-26

    Not only that, but disallowing the user to change fields is a [direct violation of Apple's HIG and grounds for app rejection](https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/Principles/Principles.html#//apple_ref/doc/uid/TP40006556-CH5-SW6) bq. People, not apps, should initiate and control actions. Although an app can suggest a course of action or warn about dangerous consequences, it’s usually a mistake for the app to take decision-making away from the user. Moving to mark as invalid.
  3. Vishal Duggal 2012-10-30

    Will see if tis can be handled.
  4. Vishal Duggal 2012-10-30

    master PR https://github.com/appcelerator/titanium_mobile/pull/3355 3_0_X PR https://github.com/appcelerator/titanium_mobile/pull/3365 2_1_X PR https://github.com/appcelerator/titanium_mobile/pull/3366
  5. Natalie Huynh 2012-11-01

    Tested with 2.1.4.v20121030173408 on iPhone 4s 6.0

JSON Source