From 5e6fa77c649954c7c1aff842b4b49d2d806af586 Mon Sep 17 00:00:00 2001 From: Jane Chu <7559015+janechu@users.noreply.github.com> Date: Thu, 9 Sep 2021 16:22:07 -0700 Subject: [PATCH] fix: resolve an issue where linked data that cannot be dropped on was not allowed to drop (#5175) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Pull Request ## 📖 Description This change adds the linked data type corresponding to linked data that typically includes elements such as `` and `` which do not contain content to a list of items that now allow it to be dropped. ## 👩‍💻 Reviewer Notes Build and run Creator application and add an `img` element, and another container element such as `div`, then attempt to drag the `img` into the `div`. This should now be possible. ## 📑 Test Plan As part of the drag and drop core functionality, this is untestable in unit tests. ## ✅ Checklist ### General - [x] I have included a change request file using `$ yarn change` - [ ] I have added tests for my changes. - [x] I have tested my changes. - [ ] I have updated the project documentation to reflect my changes. - [x] I have read the [CONTRIBUTING](https://github.com/Microsoft/fast/blob/master/CONTRIBUTING.md) documentation and followed the [standards](https://www.fast.design/docs/community/code-of-conduct/#our-standards) for this project. --- ...tooling-react-b2a5da63-bda5-4b37-80c9-e6b2ecc5ed00.json | 7 +++++++ .../src/navigation/navigation-tree-item.tsx | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 change/@microsoft-fast-tooling-react-b2a5da63-bda5-4b37-80c9-e6b2ecc5ed00.json diff --git a/change/@microsoft-fast-tooling-react-b2a5da63-bda5-4b37-80c9-e6b2ecc5ed00.json b/change/@microsoft-fast-tooling-react-b2a5da63-bda5-4b37-80c9-e6b2ecc5ed00.json new file mode 100644 index 00000000000..86a5c5f9be7 --- /dev/null +++ b/change/@microsoft-fast-tooling-react-b2a5da63-bda5-4b37-80c9-e6b2ecc5ed00.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "allow linked data that has no default droppable location to drop onto other drop targets", + "packageName": "@microsoft/fast-tooling-react", + "email": "7559015+janechu@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/tooling/fast-tooling-react/src/navigation/navigation-tree-item.tsx b/packages/tooling/fast-tooling-react/src/navigation/navigation-tree-item.tsx index 56d51b604fa..610a4c72105 100644 --- a/packages/tooling/fast-tooling-react/src/navigation/navigation-tree-item.tsx +++ b/packages/tooling/fast-tooling-react/src/navigation/navigation-tree-item.tsx @@ -222,7 +222,7 @@ export const DraggableNavigationTreeItem: React.FC = ({ }); const dragSource: ConnectDragSource = drag[1]; const drop: [{}, DragElementWrapper] = useDrop({ - accept: [DragDropItemType.linkedData], + accept: [DragDropItemType.linkedData, DragDropItemType.linkedDataUndroppable], hover(item: DragObjectWithType, monitor: DropTargetMonitor): void { /** * When the hovered element changes, reset the cached ref and