Results 1 to 5 of 5

Thread: Why does a textfield gain focus without tapping?

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    7
    Vote Rating
    0
      0  

    Default Why does a textfield gain focus without tapping?

    I've noted that when I navigate to some of my form panel views, they automatically gain focus in a text field. Other form views that I navigate to don't.

    That happens despite all my views being based on almost identical code as below.

    This happens on the iOS simulator and makes the keyboard pop up although no text field was tapped.

    Any ideas how to prevent this erratic behavior?

    Code:
    Ext.define('MyApp.view.TextView', {
        extend:   'Ext.navigation.View',
        requires: ['Ext.form.Panel', 'Ext.form.FieldSet'],
        xtype:    'text',
        config: {
    
    
            navigationBar: {
                items: [
                    {
                        xtype:    'button',
                        iconMask: true,
                        text:     'Post Stuff',
                        align:    'right',
                        action:   'postStuffButton'
                    },
                    {
                        xtype:    'button',
                        iconMask: true,
                        text:     'Close',
                        align:    'left',
                        action:   'closeButton'
                    }
                ]
            },
            items: [
                {
                    title: 'MyApp',
                    xtype: 'formpanel',
                    items: [
                        {
                            styleHtmlContent: true,
                            html :            '',
                        },                
                        {
                            xtype: 'fieldset',
                            items: [{
                                xtype:       'textfield',
                                name:        'message',
                                placeHolder: 'Your text message'
                            },{
                                xtype:       'textfield',
                                name:        'tags',
                                placeHolder: 'Up to 5 tags'
                            }]
                        },
                        {
                            xtype: 'button',
                            text:  'Post',
                            ui:    'confirm'
                        }                        
                    ]
                }
            ]
        },
    });

  2. #2
    Sencha Premium Member dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,093
    Answers
    25
    Vote Rating
    56
      0  

    Default

    does it happen on an ios device, or just in the simulator?
    Lead Trainer / Sencha Specialist
    Community And Learning Systems

    Lead Architect
    DigitalTickets.net

  3. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    7
    Vote Rating
    0
      0  

    Default

    just in the iOS simulator (v6) -- I haven't provisioned yet to run on a device -- have you seen this issue in your apps?

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default

    I have a similar problem, see http://www.sencha.com/forum/showthre...intended-focus.

    Is there an element from for example an overlapping view which is clicked first, and is located at the same position?

  5. #5
    Sencha User
    Join Date
    Sep 2012
    Posts
    7
    Vote Rating
    0
      0  

    Default

    not really - it just focuses as soon as the view is loaded

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •