Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#15133 closed defect (fixed)

dijit/focus: spurious curNode=null notification

Reported by: bill Owned by: bill
Priority: undecided Milestone: 1.8
Component: Dijit Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

See attached test case. Tabbing through the inputs causes a watch("curNode", func) callback where newValue=null (or undefined), rather than the <input>. It's followed by the correct notification that curNode was set to one of the <input>'s.

Kris' "focusin" event doesn't seem to have this problem, so should probably upgrade dijit/focus to use that.

Attachments (3)

focusin.html (877 bytes) - added by bill 8 years ago.
test case showing watch("curNode") bug on IE8, and also showing on(<body>, "focusin") working correctly
focus.patch (360 bytes) - added by Martin Repta 8 years ago.
onFocusHint.patch (3.4 KB) - added by bill 8 years ago.
patch for more places to hint to focus manager when a node is focused, but doesn't help the grid case

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by bill

Attachment: focusin.html added

test case showing watch("curNode") bug on IE8, and also showing on(<body>, "focusin") working correctly

comment:1 Changed 8 years ago by bill

Summary: dijit/focus: spurious curNode=null notification (IE)dijit/focus: spurious curNode=null notification

comment:2 Changed 8 years ago by bill

Owner: set to bill
Resolution: fixed
Status: newclosed

In [28298]:

Avoid spurious curNode=null notification when tabbing between nodes, fixes#15133 !strict.

comment:3 Changed 8 years ago by bill

Milestone: tbd1.8

comment:4 Changed 8 years ago by Martin Repta

Hi, we have found out, that your patch affected behaviour of editable cells in dojox/grid/EnhancedGrid widget. The problem is, you are not able to edit any grid cells. This problem appears only in Google Chrome.

Snippet of code to simulate it:

<TABLE id="grid2" data-dojo-type="dojox/grid/EnhancedGrid" data-dojo-props="autoHeight:true, singleClickEdit:true, selectionMode:'single'">
    <THEAD>
      <TR>
        <TH field="contintent" cellType="dojox.grid.cells._Widget" widgetClass="dijit.form.TextBox" editable="true" width="100%">Continent</TH>
      </TR>
    </THEAD>
  </TABLE>

    <script type="text/javascript">
    
      require([
        "dojo/ready",
        "dijit/dijit",
        "dojo/_base/lang",
        "__mocks/store",
        "dojox/grid/EnhancedGrid",
        "dijit/form/TextBox",
        "dojox/grid/cells/dijit"
        
      ], function(ready, dijit, lang, store) {
        ready(function() {
          dijit.byId('grid2').setStore(store);
        });
      });

    </script>

Problem is in _clearActiveWidgetsTimer function, in timout value. Patch file is attached.

Changed 8 years ago by Martin Repta

Attachment: focus.patch added

comment:5 Changed 8 years ago by bill

Hmm. I see the problem you are talking about, but it seems like a grid issue, so I filed #15167.

The 0ms timeout is intentional. It's for when a user clicks on a non-focusable button (or image, or whatever) in order to trigger a Dialog. When the user closex the Dialog, the Dialog tries to restore focus to wherever it was previously, which means that we want to notice that the mousedown on the non-focusable button/image cleared the focus before the mouseup causes the Dialog to appear. (Actually, this is what requires 0ms timeout for the curNode, not for the widget stack, but it seems like they should both have the same timeout.)

Last edited 8 years ago by bill (previous) (diff)

Changed 8 years ago by bill

Attachment: onFocusHint.patch added

patch for more places to hint to focus manager when a node is focused, but doesn't help the grid case

Note: See TracTickets for help on using tickets.