Skip to content

[codex] Preserve existing item position checks - #1001

Open
nexiumbiz-debug wants to merge 1 commit into
tiberiuzuld:masterfrom
nexiumbiz-debug:codex/preserve-existing-next-position-907
Open

[codex] Preserve existing item position checks#1001
nexiumbiz-debug wants to merge 1 commit into
tiberiuzuld:masterfrom
nexiumbiz-debug:codex/preserve-existing-next-position-907

Conversation

@nexiumbiz-debug

Copy link
Copy Markdown
Contributor

Summary

  • keep getNextPossiblePosition(existingItem) from moving an already valid dashboard item to the first open grid slot
  • ignore the owning item component when collision-checking an existing item passed through the public API
  • add a regression spec for checking an existing item without changing its x/y

Fixes #907.

Root cause

getNextPossiblePosition searches from the top-left of the grid and mutates the item object as it searches. When callers pass an item that already belongs to the rendered dashboard just to check for available space, the method can treat the item as a new placement candidate and rewrite its coordinates.

Validation

  • npm run test-lib -- --watch=false
  • npm run build-lib
  • npx eslint projects/angular-gridster2/src/lib/tests/gridster.spec.ts
  • npx eslint projects/angular-gridster2/src/lib/gridster.ts projects/angular-gridster2/src/lib/tests/gridster.spec.ts (blocked by pre-existing upstream gridster.ts lint errors: component selector, prefer-for-of, no-inferrable-types, unused eslint-disable)
  • git diff --check (only the repo's LF/CRLF warning)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getNextPossiblePosition() method issue

1 participant