Results 1 to 5 of 5

Thread: Viewport: focusedElement.blur is not a function

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member
    Join Date
    Aug 2013
    Posts
    7

    Default Viewport: focusedElement.blur is not a function

    Hello, I am not sure why a method is called after the object is deleted?

    Package: touch-2.4.1-commercial.zip
    File: touch-2.4.1/src/viewport/Default.js
    Code fragment:

    doBlurInput: function(e) {
    var target = e.target,
    focusedElement = this.focusedElement;
    //In IE9/10 browser window loses focus and becomes inactive if focused element is <body>. So we shouldn't call blur for <body>
    if (focusedElement && focusedElement.nodeName.toUpperCase() != 'BODY' && !this.isInputRegex.test(target.tagName)) {
    delete this.focusedElement;
    focusedElement.blur(); // *** raises "TypeError: focusedElement.blur is not a function" ***
    }
    },




  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    Do you have a test case? Also what version of Sencha Touch 2.x.x are you using and what mobile platform are you experiencing this issue on?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    94

    Default

    Hi,we can also repro this running under IE11 (windows devices) using ST 2.3.0.We have had to override the Ext.viewport.Default to ensure blur is only called if the element has one.

  4. #4

    Default Found solution for focusedElement.blur error!!!!

    I found solution for this error. Add Try and catch for blur function.

    doBlurInput: function(e) {
    var target = e.target,
    focusedElement = this.focusedElement;

    if (focusedElement && focusedElement.nodeName.toUpperCase() != 'BODY' && !this.isInputRegex.test(target.tagName)) {
    delete this.focusedElement;
    try{
    focusedElement.blur();
    }catch(e){ }

    }
    }

    May be its not good to modify default.js. But it help me to remove that error.

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Posts
    130

    Default

    I have this problem too. Console fires "TypeError: focusedElement.blur is not a function" when I double click empty places, sometimes, when I use Firefox 39.0. I wasn't able to reproduce this in Google Chrome 43.0.2357.132 m (64-bit) and Internet Explorer 11.0.9600.17843. Windows 7

    This happens on viewport/Default.js:380:12

Posting Permissions

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