From 62cda7d15e278ad0adadf3dad1bd156a3d82ee3c Mon Sep 17 00:00:00 2001 From: Ofekino <110312442+Ofekino@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:23:19 +0200 Subject: [PATCH 1/7] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 3fd5d72..4d657a2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # react-native-drag-sort Drag and drop sort control for react-native +This is a fork that fixes AutoDragSortableView's bug, where when you try to drag, you're able to drag a bit to the right, which shouldn't happen as it's a one column list. + + ![GitHub license](https://img.shields.io/badge/license-MIT-green.svg) [![npm](https://img.shields.io/npm/v/react-native-drag-sort.svg?style=flat)](https://npmjs.com/package/react-native-drag-sort) From 8fcc9c70716bc77226b317c2791ec048e83adb4d Mon Sep 17 00:00:00 2001 From: Ofekino <110312442+Ofekino@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:23:49 +0200 Subject: [PATCH 2/7] Update AutoDragSortableView.js --- lib/AutoDragSortableView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AutoDragSortableView.js b/lib/AutoDragSortableView.js index 74d46d5..e55312b 100644 --- a/lib/AutoDragSortableView.js +++ b/lib/AutoDragSortableView.js @@ -315,7 +315,7 @@ export default class AutoDragSortableView extends Component{ } } - const left = this.touchCurItem.originLeft + dx; + const left = this.touchCurItem.originLeft; // + dx const top = this.touchCurItem.originTop + dy; this.touchCurItem.ref.setNativeProps({ From 32424a980edcd7fcb8ca4bda65c7396cabe4f8f8 Mon Sep 17 00:00:00 2001 From: Ofekino <110312442+Ofekino@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:27:31 +0200 Subject: [PATCH 3/7] Update DragSortableView.js --- lib/DragSortableView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DragSortableView.js b/lib/DragSortableView.js index 6170f82..592c737 100644 --- a/lib/DragSortableView.js +++ b/lib/DragSortableView.js @@ -174,7 +174,7 @@ export default class DragSortableView extends Component{ } } - let left = this.touchCurItem.originLeft + dx + let left = this.touchCurItem.originLeft //+ dx let top = this.touchCurItem.originTop + dy this.touchCurItem.ref.setNativeProps({ From a0d4f8ce22a716ac0f288ba25b86ad358c9777fc Mon Sep 17 00:00:00 2001 From: Ofekino <110312442+Ofekino@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:27:58 +0200 Subject: [PATCH 4/7] Update DragSortableView.js --- lib/DragSortableView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DragSortableView.js b/lib/DragSortableView.js index 592c737..bf979d5 100644 --- a/lib/DragSortableView.js +++ b/lib/DragSortableView.js @@ -174,7 +174,7 @@ export default class DragSortableView extends Component{ } } - let left = this.touchCurItem.originLeft //+ dx + let left = this.touchCurItem.originLeft // + dx let top = this.touchCurItem.originTop + dy this.touchCurItem.ref.setNativeProps({ From 997653cfaa27e0157de3b3871574988e016463a2 Mon Sep 17 00:00:00 2001 From: Ofekino <110312442+Ofekino@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:28:28 +0200 Subject: [PATCH 5/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d657a2..9159a80 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # react-native-drag-sort Drag and drop sort control for react-native -This is a fork that fixes AutoDragSortableView's bug, where when you try to drag, you're able to drag a bit to the right, which shouldn't happen as it's a one column list. +This is a fork that fixes DragSortableView / AutoDragSortableView's bug, where when you try to drag, you're able to drag a bit to the right, which shouldn't happen as it's a one column list. ![GitHub license](https://img.shields.io/badge/license-MIT-green.svg) From f320cf660496ec3b0e1b5c365a1f7d84f7cc5fdc Mon Sep 17 00:00:00 2001 From: Offek <110312442+Ofekino@users.noreply.github.com> Date: Wed, 21 Feb 2024 18:39:24 +0200 Subject: [PATCH 6/7] Create npm-publish.yml --- .github/workflows/npm-publish.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..6cdebaf --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,33 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} From ba80a1d447bb9ae06e7119a29d7e4f870ac903f4 Mon Sep 17 00:00:00 2001 From: Offek <110312442+Ofekino@users.noreply.github.com> Date: Wed, 21 Feb 2024 18:40:14 +0200 Subject: [PATCH 7/7] Create npm-publish-github-packages.yml --- .../workflows/npm-publish-github-packages.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/npm-publish-github-packages.yml diff --git a/.github/workflows/npm-publish-github-packages.yml b/.github/workflows/npm-publish-github-packages.yml new file mode 100644 index 0000000..47a37f9 --- /dev/null +++ b/.github/workflows/npm-publish-github-packages.yml @@ -0,0 +1,36 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm ci + - run: npm test + + publish-gpr: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://npm.pkg.github.com/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}