Skip to content

[codex] Reset drag direction between drags#997

Open
nexiumbiz-debug wants to merge 1 commit into
tiberiuzuld:masterfrom
nexiumbiz-debug:codex/reset-boundary-drag-state-854
Open

[codex] Reset drag direction between drags#997
nexiumbiz-debug wants to merge 1 commit into
tiberiuzuld:masterfrom
nexiumbiz-debug:codex/reset-boundary-drag-state-854

Conversation

@nexiumbiz-debug

Copy link
Copy Markdown
Contributor

Summary

  • reset the draggable lastMouse baseline when a new drag starts so direction checks do not reuse the previous drag's pointer position
  • clear the baseline again when drag stops
  • add a regression spec showing a second drag starts from the current pointer and correctly treats movement away from the right edge as LEFT

Addresses the stale lastMouse part of #854.

Tests

  • npm run test-lib -- --watch=false
  • npm run build-lib
  • npx eslint projects/angular-gridster2/src/lib/gridsterDraggable.ts projects/angular-gridster2/src/lib/tests/gridsterDraggable.spec.ts
  • git diff --check

}

private resetLastMouse(e?: MouseEvent): void {
this.lastMouse.clientX = e?.clientX ?? 0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should reset to 0, since getDirections needs to set current position of mouse from dragMove mouse event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants