From 5dab2ec970f45cedb845b5111115a2d2455cb5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E6=96=87=E9=9B=84?= Date: Sun, 27 Oct 2019 23:13:47 +0800 Subject: [PATCH] fix: drag bug --- src/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.js b/src/index.js index 1f603c0..ccb2e81 100644 --- a/src/index.js +++ b/src/index.js @@ -75,6 +75,9 @@ export default class JsonSchemaForm extends React.PureComponent { this.changeStore(store=>{ const arr = getData(this.state.store.value, paths); const newArr = arrMove(arr, from ,to) + if(paths.length === 0){ + return store.value = newArr; + } setData(store.value, paths, newArr) }) }