Skip to content

Commit 89a1f52

Browse files
committed
!!! BUGFIX: fix dnd
We need to pass correct context to react-dnd
1 parent faa6169 commit 89a1f52

File tree

3 files changed

+79
-35
lines changed

3 files changed

+79
-35
lines changed

Resources/Private/StructuredEditing/src/manifest.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import ReactDOM from 'react-dom';
44
import manifest from '@neos-project/neos-ui-extensibility';
55
import {selectors} from '@neos-project/neos-ui-redux-store';
66
import {DropDown, Icon} from '@neos-project/react-ui-components';
7-
import {withDragDropContext} from '@neos-project/neos-ui-decorators';
87
import {connect} from 'react-redux';
98
import {$transform, $get} from 'plow-js';
109
import EditorEnvelope from '@neos-project/neos-ui-editors';
1110
import {NeosContext} from '@neos-project/neos-ui-decorators';
11+
import {DragDropContextProvider} from 'react-dnd';
12+
import HTML5Backend from 'react-dnd-html5-backend';
1213

13-
@withDragDropContext
1414
@connect($transform({
1515
currentlyEditedPropertyName: selectors.UI.ContentCanvas.currentlyEditedPropertyName,
1616
getNodeByContextPath: selectors.CR.Nodes.nodeByContextPath,
@@ -117,20 +117,23 @@ manifest('Flowpack.StructuredEditing:EditorEnvelope', {}, (globalRegistry, {rout
117117
bootstrap: () => null,
118118
createInlineEditor: config => {
119119
const domNode = config.propertyDomNode;
120+
const guestWindow = domNode.ownerDocument.defaultView;
120121
const fusionPath = findParentFusionPath(domNode, config.contextPath);
121122
ReactDOM.render(
122123
(
123-
<NeosContext.Provider value={{configuration, globalRegistry, routes}}>
124-
<InlineEditorEnvelope
125-
globalRegistry={globalRegistry}
126-
routes={routes}
127-
configuration={configuration}
128-
store={store}
129-
fusionPath={fusionPath}
130-
nodeTypesRegistry={nodeTypesRegistry}
131-
{...config}
132-
/>
133-
</NeosContext.Provider>
124+
<DragDropContextProvider backend={HTML5Backend} context={guestWindow}>
125+
<NeosContext.Provider value={{configuration, globalRegistry, routes}}>
126+
<InlineEditorEnvelope
127+
globalRegistry={globalRegistry}
128+
routes={routes}
129+
configuration={configuration}
130+
store={store}
131+
fusionPath={fusionPath}
132+
nodeTypesRegistry={nodeTypesRegistry}
133+
{...config}
134+
/>
135+
</NeosContext.Provider>
136+
</DragDropContextProvider>
134137
), domNode);
135138
},
136139
ToolbarComponent: () => null

Resources/Public/JavaScript/StructuredEditing/Plugin.js

Lines changed: 62 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/Public/JavaScript/StructuredEditing/Plugin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)