Skip to content

Commit

Permalink
Editor: fix editOn cell reverting to read state when widget dropdown …
Browse files Browse the repository at this point in the history
…is opened

If a cell has 'editOn: "click"' and dijit/form/Select as the editor, clicking
the cell displays the Select, but clicking the Select to open the dropdown
causes a blur which reverts the cell to the read state. This change ignores
blur events from clicking within the dropdown.
  • Loading branch information
msssk committed May 14, 2020
1 parent adf4d59 commit 0d6a7eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,12 @@ define([
function onblur(event) {
var wrapperNode;

// a blur caused by clicking within an editor widget's dropDown (e.g. dijit/form/Select) should be
// ignored, otherwise the cell reverts to the read state when the user opens the dropdown
if (cmp.dropDown && cmp.dropDown.domNode.contains(event.relatedTarget || document.activeElement)) {
return;
}

if (event && event.target) {
wrapperNode = event.target;
wrapperNode = domClass.contains(wrapperNode, self.editorFocusWrapperClassName) && wrapperNode;
Expand Down
5 changes: 3 additions & 2 deletions test/Editor_more_widgets.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
font-weight: bold;
padding-bottom: 0.25em;
}
#grid .field-date, #grid .field-date2 {
#grid .field-date,
#grid .field-date2 {
width: 16em;
}
#grid .field-integer {
width: 6em;
}
#grid .field-bool {
width: 6em;
width: 7em;
}
.dgrid {
margin: 10px;
Expand Down

0 comments on commit 0d6a7eb

Please sign in to comment.