From 7934c38ed641f4a10cd008fe415a50aef1240e10 Mon Sep 17 00:00:00 2001
From: mehekj <mehek.jethani@gmail.com>
Date: Mon, 3 Apr 2023 17:28:51 -0400
Subject: fixed dragging doc out of schema and removing schema column sort

---
 .../views/collections/collectionSchema/SchemaColumnHeader.tsx     | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx')

diff --git a/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx b/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx
index cbdaeb933..43895fc9c 100644
--- a/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx
@@ -12,7 +12,7 @@ export interface SchemaColumnHeaderProps {
     columnIndex: number;
     sortField: string;
     sortDesc: boolean;
-    setSort: (field: string, desc: boolean) => void;
+    setSort: (field: string | undefined, desc?: boolean) => void;
     removeColumn: (index: number) => void;
     resizeColumn: (e: any, index: number) => void;
     dragColumn: (e: any, index: number) => boolean;
@@ -30,8 +30,10 @@ export class SchemaColumnHeader extends React.Component<SchemaColumnHeaderProps>
     sortClicked = (e: React.PointerEvent) => {
         e.stopPropagation();
         e.preventDefault();
-        if (this.props.sortField == this.fieldKey) {
-            this.props.setSort(this.fieldKey, !this.props.sortDesc);
+        if (this.props.sortField == this.fieldKey && this.props.sortDesc) {
+            this.props.setSort(undefined);
+        } else if (this.props.sortField == this.fieldKey) {
+            this.props.setSort(this.fieldKey, true);
         } else {
             this.props.setSort(this.fieldKey, false);
         }
-- 
cgit v1.2.3-70-g09d2

