Results 1 to 2 of 2

Thread: Focus modern textfield on load and maintain focus throughout use until submission

  1. #1
    Sencha User
    Join Date
    Jun 2018
    Posts
    3
    Vote Rating
    0
      0  

    Default Focus modern textfield on load and maintain focus throughout use until submission

    I am attempting to automatically focus a modern textfield on load and keep it focused all the time, even when blurred. I was successful with this in the classic version, but am having issues with the modern version for some reason. Essentially, mock a click on the textfield on initialization and then keep focus. Below is the code I used in the classic version:

    Code:
    ...
    // Maintain focus always on input            
    
    listeners: {
                    afterrender: function(fld) {
                        fld.focus(false, 10);
                    },
    
                    blur: function(fld) {
                        fld.focus(false, 10);
                    }
                }
    ...
    

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890
    Answers
    41
    Vote Rating
    90
      0  

    Default

    Modern doesn't have render: https://docs.sencha.com/extjs/6.2.0/...nt.html#events

    A Component's element exists from the beginning.

    Try focus on https://docs.sencha.com/extjs/6.2.0/...#event-painted

    And then again on https://docs.sencha.com/extjs/6.2.0/...ent-focusleave

Similar Threads

  1. focus textfield extjs 6.5.2 modern
    By souhail72 in forum Ext JS 6.x Q&A
    Replies: 6
    Last Post: 22 Nov 2017, 11:10 AM
  2. Replies: 1
    Last Post: 3 Jan 2011, 8:23 AM
  3. Issue with TextField focus (not at page load time)
    By gnaigaonkar in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 1 Jul 2009, 10:17 AM

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
  •