Skip to content

Commit

Permalink
Merge branch '21_1' of https://github.com/DevExpress/DevExtreme into …
Browse files Browse the repository at this point in the history
…21_1
  • Loading branch information
EugeniyKiyashko committed Aug 2, 2021
2 parents ae2c5bc + 69aa26e commit c7241b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions js/ui/file_manager/ui.file_manager.files_tree_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class FileManagerFilesTreeView extends Widget {

_onFilesTreeViewItemContextMenu({ itemElement, event }) {
event.preventDefault();
event.stopPropagation();
const itemData = $(itemElement).data('item');
this._contextMenu.showAt([ itemData ], itemElement, event, { itemData, itemElement });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,21 @@ QUnit.module('Raise context menu', moduleConfig, () => {
assert.equal($items.length, 0, 'context menu is invisible');
});

test('event propagation is stopped for click by folder node T1009625', function(assert) {
const done = assert.async();
this.wrapper.getInstance().option({
onContextMenuShowing: function({ event }) {
assert.ok(event.isDefaultPrevented(), 'default is prevented');
assert.ok(event.isPropagationStopped(), 'propagation is stopped');
done();
}
});
assert.equal(this.wrapper.getContextMenuItems(true).length, 0, 'context menu is hidden');

this.wrapper.getFolderNode(1).trigger('dxcontextmenu');
assert.ok(this.wrapper.getContextMenuItems(true).length > 0, 'context menu is shown');
});

});

QUnit.module('Cutomize context menu', moduleConfig, () => {
Expand Down

0 comments on commit c7241b0

Please sign in to comment.