Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -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}}
33 changes: 33 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -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}}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# react-native-drag-sort
Drag and drop sort control for react-native

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)
[![npm](https://img.shields.io/npm/v/react-native-drag-sort.svg?style=flat)](https://npmjs.com/package/react-native-drag-sort)

Expand Down
2 changes: 1 addition & 1 deletion lib/AutoDragSortableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion lib/DragSortableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down