Skip to content
Merged
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
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,39 @@ const mock = new ResizeObserverMock();

## Development

### How to write unit-tests?
Repo description and how to work with

### File structure

- `src` folder contains files that will be compiled
- `public` folder contains files that will be added to package as is

### Writing unit-tests

Test for module `{path}/{module}.ts` should be placed in `{path}/__test__/{module}.test.ts`.

By default test environment is just Node.js environment.

For write tests with simulating browser environment you need to name test file like `a.web.test.ts`.
For write tests with simulating browser environment you need to name test file like `*.web.test.ts`.

### Package structure
### Exports convention

- `src` folder contains files that will be compiled
- `public` folder contains files that will be added to package as is
Any exported file from this package should not contain default exports (`export default ...`).
Defaults exports are hard to work with and less compatible between ESM and CJS.

### Exports convention
### Environment setup

First you need to use suitable Node.js version, for example by `nvm`:

Any exported file from this package should not contain default exports (`export default ...`). Defaults exports are hard to work with and less compatible between ESM and CJS.
```shell
nvm use && npm install
```

### VSCode setup

This command will create/update `.vscode/settings.json`

```shell
# Will update .vscode/settings.json
npm run setup -- --vscode
```

Expand Down
2 changes: 1 addition & 1 deletion src/react/drag-and-drop/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class DragAndDropObserver {
* @param ctx Context.
*/
protected handlePointerRelease(event: PointerEvent, ctx: DragAndDropObserverContext): void {
if (!this.state.grabbed || this.state.pointerId !== event.pointerId) {
if (!this.state.pressed || this.state.pointerId !== event.pointerId) {
return;
}

Expand Down
Loading