diff --git a/js/ui/file_manager/ui.file_manager.files_tree_view.js b/js/ui/file_manager/ui.file_manager.files_tree_view.js index 9a7eac62b564..e206787a038e 100644 --- a/js/ui/file_manager/ui.file_manager.files_tree_view.js +++ b/js/ui/file_manager/ui.file_manager.files_tree_view.js @@ -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 }); } diff --git a/testing/tests/DevExpress.ui.widgets/fileManagerParts/contextMenu.tests.js b/testing/tests/DevExpress.ui.widgets/fileManagerParts/contextMenu.tests.js index 60349ff703b8..a6dfc2e40b20 100644 --- a/testing/tests/DevExpress.ui.widgets/fileManagerParts/contextMenu.tests.js +++ b/testing/tests/DevExpress.ui.widgets/fileManagerParts/contextMenu.tests.js @@ -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, () => {