From 79b6a250b6924c66733c14c0b5232df85872c1f2 Mon Sep 17 00:00:00 2001 From: usodhi <61431818+usodhi@users.noreply.github.com> Date: Sun, 6 Sep 2020 01:32:11 +0530 Subject: fixes to row drop --- .../views/collections/CollectionMasonryViewFieldRow.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/client/views/collections') diff --git a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx index dd4f01a88..1b6f047ea 100644 --- a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx +++ b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx @@ -2,7 +2,7 @@ import React = require("react"); import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { action, computed, observable, runInAction } from "mobx"; import { observer } from "mobx-react"; -import { Doc, DataSym } from "../../../fields/Doc"; +import { Doc, DocListCast } from "../../../fields/Doc"; import { PastelSchemaPalette, SchemaHeaderField } from "../../../fields/SchemaHeaderField"; import { ScriptField } from "../../../fields/ScriptField"; import { StrCast, NumCast } from "../../../fields/Types"; @@ -90,7 +90,14 @@ export class CollectionMasonryViewFieldRow extends React.Component d[key] = d[DataSym][key] = castedValue); + let onLayoutDoc = false; + for (const doc of DocListCast(this.props.parent.Document.data)) { + if (Doc.Get(doc, key, true)) { + onLayoutDoc = true; + break; + } + } + de.complete.docDragData.droppedDocuments.forEach(d => Doc.SetInPlace(d, key, castedValue, !onLayoutDoc)); this.props.parent.onInternalDrop(e, de); e.stopPropagation(); } -- cgit v1.2.3-70-g09d2