From 6a42ef50ec20037db2cad0439af00ffe4e8eaf68 Mon Sep 17 00:00:00 2001
From: Laurent Cozic <laurent@cozic.net>
Date: Sun, 21 Jul 2019 13:55:25 +0100
Subject: [PATCH] All: Fixes #1732: Fixed note order when dragging a note
 outside a notebook

---
 ReactNativeClient/lib/models/Note.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/ReactNativeClient/lib/models/Note.js b/ReactNativeClient/lib/models/Note.js
index d4cc01832a..eab34df9c0 100644
--- a/ReactNativeClient/lib/models/Note.js
+++ b/ReactNativeClient/lib/models/Note.js
@@ -232,8 +232,12 @@ class Note extends BaseItem {
 
 			for (let i = 0; i < orders.length; i++) {
 				const order = orders[i];
-				if (a[order.by] < b[order.by]) r = +1;
-				if (a[order.by] > b[order.by]) r = -1;
+				let aProp = a[order.by];
+				let bProp = b[order.by];
+				if (typeof aProp === 'string') aProp = aProp.toLowerCase();
+				if (typeof bProp === 'string') bProp = bProp.toLowerCase();
+				if (aProp < bProp) r = +1;
+				if (aProp > bProp) r = -1;
 				if (order.dir == 'ASC') r = -r;
 				if (r !== 0) return r;
 			}