Opened 7 years ago

Closed 7 years ago

#15167 closed defect (fixed)

[regression] editable grid cells broken after #15133 (Chrome)

Reported by: bill Owned by: Evan
Priority: blocker Milestone: 1.8
Component: DojoX Grid Version: 1.7.2
Keywords: Cc: chrisacky
Blocked By: Blocking:

Description

My fix for #15133 breaks editing grid cells, but I think it's a problem that I exposed in the Grid code.

The problem can be seen in dojox/grid/tests/test_data_grid_edit_dijit.html on Chrome. Double-clicking a cell to edit it doesn't switch the cell to edit mode.

The problem is in _EditManager::start(), which ends up calling _View::buildRowContent(), causing a blur event by obliterating the focused HTML:

buildRowContent: function(inRowIndex, inRowNode){
        inRowNode.innerHTML = this.content.generateHtml(inRowIndex, inRowIndex);
        ...

To counteract that, _EditManager::start() then immediately does:

// make sure we don't utterly lose focus
this.grid.focus.focusGrid();

and focusGrid() calls _focusifyCellNode(), which normally would focus the cell, but in this case doesn't do anything because the grid is in edit mode:

_focusifyCellNode: function(inBork){
                ...
                                        if(!this.grid.edit.isEditing()){
                                                ...

Eventually Grid sets a timeout which then creates the widget (a ComboBox widget in the above test case), and then focuses it. That sequence of events though takes about 30ms, which is enough time for the focus manager to decide that grid itself has blurred.

It seems like the _focusifyCellNode() function should focus the cell even though the grid is about to be edited.

Change History (5)

comment:1 Changed 7 years ago by bill

Milestone: tbd1.8

comment:2 Changed 7 years ago by bill

#15596 is a duplicate of this ticket.

comment:3 Changed 7 years ago by bill

Priority: undecidedblocker
Summary: editable grid cells broken after #15133 (Chrome)[regression] editable grid cells broken after #15133 (Chrome)

comment:4 Changed 7 years ago by Evan

Cc: chrisacky added
Status: newassigned

comment:5 Changed 7 years ago by Evan

Resolution: fixed
Status: assignedclosed

In [29148]:

Fixes #15167, in chrome and safari, always focus on cell node disregard the editing state

Note: See TracTickets for help on using tickets.