Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    debugging native blur

    Is there any way to trace blur call on elements in the debugger? I've tried adding nativeBlur logging and set it to debug but nothing shows. I only get the following when I have nativeFocus, traceFocus, and nativeBlur set to Debug:

    I am trying to debug where the onblur call is coming from

    12:48:08.194:TMR6:WARN:Log:********* SET FOCUS [Button ID:page$$content$nextNoScroll]
    12:48:08.202:TMR6:INFO:nativeFocus:page$$content$nextNoScroll:about to call native focus()
    Class.getStackTrace(_1=>undef, _2=>undef, _3=>undef, _4=>undef)
    Canvas.setFocus(_1=>true, _2=>undef)
    Canvas.focus(_1=>undef)
    CanvasItem.focusInItem(_1=>undef)
    callback()
    [c]Class.fireCallback(_1=>callback(), _2=>undef, _3=>Array[0], _4=>[object Window], _5=>true) on [Class Timer]
    [c]Timer.$in(_1=>"$ir253")

    [Complete stack trace logged via Firebug: FBugTrace15]
    12:48:08.202:TMR6:WARN:Log:********* SET FOCUS [Button ID:page$$content$nextNoScroll]
    12:48:09.344:BLR9:DEBUG:nativeFocus:onblur fired on: [Button ID:page$$content$nextNoScroll]

    #2
    If someone could answer me real quickly, that would be great. I'm stuck with this scrolling problem.

    Comment


      #3
      Try enabling 'traceBlur' at the debug level.
      Also as a general tip, you can always use the watch tab to log stack traces on *any* method -- Simply enter the object you care about in the "object" box, the method you care about in the "method" box and hit "Trace Method".

      Comment


        #4
        Great thanks. I've tried traceBlur and it still doesn't show anything. I'll try the watch suggestion

        Comment


          #5
          Stupid me - the blur call was caused by me switching windows - anyway, my main problem is the scrolling - I thought it had to do with the blur call but looks like it does not.

          Maybe you can help me make sense out of this stacktrace - I've fixed it in a standalone by setting autoFocus to false on a dynamic form that I am displaying after click but it does not work in my env. I'm interested in the last part with

          15:00:25.676:SCR5:WARN:Log:page$$content.scrollTo() - trace:
          Class.getStackTrace(_1=>undef, _2=>undef, _3=>undef, _4=>undef)
          scrollToObservation(left=>0, top=>0, reason=>"nativeScroll", animating=>undef)
          Canvas.$lh(_1=>undef, _2=>undef)
          onscroll(event=>[object Event])
          "return page$$content.$lh();"


          Code:
          15:00:25.299:FCS8:DEBUG:nativeFocus:onfocus fired on: [Button ID:page$$content$upScroll]
          15:00:25.317:MDN0:INFO:nativeFocus:page$$content$backNoReset:about to call native focus()
              Class.getStackTrace(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
              Canvas.setFocus(_1=>true,  _2=>"focus on mousedown")
              Canvas.focus(_1=>"focus on mousedown")
              [c]EventHandler._$observed_doHandleMouseDown(_1=>[object MouseEvent],  _2=>undef)
              doHandleMouseDownObservation(_1=>[object MouseEvent],  _2=>undef)
              [c]EventHandler.handleMouseDown(_1=>[object MouseEvent],  _2=>undef)
              [c]EventHandler.dispatch(_1=>[c]EventHandler.handleMouseDown(),  _2=>[object MouseEvent])
              anonymous(event=>[object MouseEvent])
          
           [Complete stack trace logged via Firebug: FBugTrace369]
          15:00:25.317:BLR1:DEBUG:nativeFocus:onblur fired on: [Button ID:page$$content$upScroll]
          15:00:25.318:FCS2:DEBUG:nativeFocus:onfocus fired on: [Button ID:page$$content$backNoReset]
          15:00:25.383:MUP6:WARN:Log:***CLICK ACTION FIRED ON : [Button ID:page$$content$backNoReset]
          15:00:25.383:MUP6:WARN:Log:*** IN CLICK ACTION CURRENTFOCUSCANVAS IS : [Button ID:page$$content$backNoReset]
          15:00:25.461:TMR4:WARN:Log:********* SET FOCUS TIMEOUT [Button ID:page$$content$backNoReset]
          15:00:25.472:TMR4:INFO:nativeFocus:page$$content$backNoReset:about to call native focus()
              Class.getStackTrace(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
              Canvas.setFocus(_1=>true,  _2=>undef)
              Canvas.focus(_1=>undef)
              callback()
              [c]Class.fireCallback(_1=>callback(),  _2=>undef,  _3=>Array[0],  _4=>[object Window],  _5=>true) on [Class Timer]
              [c]Timer.$in(_1=>"$ir1572")
          
           [Complete stack trace logged via Firebug: FBugTrace370]
          15:00:25.473:TMR4:WARN:Log:********* SET FOCUS  [Button ID:page$$content$backNoReset]
          15:00:25.481:TMR4:INFO:nativeFocus:page$$content$backNoReset:about to call native focus()
              Class.getStackTrace(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
              Canvas.setFocus(_1=>true,  _2=>undef)
              Canvas.focus(_1=>undef)
              CanvasItem.focusInItem(_1=>undef)
              callback()
              [c]Class.fireCallback(_1=>callback(),  _2=>undef,  _3=>Array[0],  _4=>[object Window],  _5=>true) on [Class Timer]
              [c]Timer.$in(_1=>"$ir1572")
          
           [Complete stack trace logged via Firebug: FBugTrace371]
          15:00:25.482:TMR4:WARN:Log:********* SET FOCUS  [Button ID:page$$content$backNoReset]
          15:00:25.676:SCR5:WARN:Log:page$$content.scrollTo() - trace:
              Class.getStackTrace(_1=>undef,  _2=>undef,  _3=>undef,  _4=>undef)
              scrollToObservation(left=>0,  top=>0,  reason=>"nativeScroll",  animating=>undef)
              Canvas.$lh(_1=>undef,  _2=>undef)
              onscroll(event=>[object Event])
                  "return page$$content.$lh();"
          
           [Complete stack trace logged via Firebug: FBugTrace372]
          15:00:28.035:BLR2:DEBUG:nativeFocus:onblur fired on: [Button ID:page$$content$backNoReset]

          Comment


            #6
            With our secret internal decoder ring, we can see that $lh is the notification method fired from a native css scroll.
            In other words we received a scroll event from the browser and are just responding to it - we didn't directly call 'scrollTo' on any component.

            Native scrolls can come from a variety of places (other than the user explicitly scrolling something). The most common cases that cause unexpected behavior are either focus going to something that is not completely in view (so the page jump-scrolls such that the element in question is visible), or content changing (shrinking in size) such that the current scroll position of some parent element is no longer valid.

            We don't know enough about your use case to tell what's happening in your specific case. As always if you can't see a logical reason for the behavior and suspect a framework issue, show us a test case (the simpler the better) and we can take a look.

            Comment


              #7
              As I have mentioned, I was able to fix it in a standalone, but the resizing part may be an idea - I have quite a few width/height in % - will investigate. Thanks for the detailed response :)

              Comment

              Working...
              X