Skip to content

Commit

Permalink
Merge pull request #2698 from adrianbenjuya/master
Browse files Browse the repository at this point in the history
Bugfix: prevent throwing error when node.grid is undefined (drag item from outside the grid)
  • Loading branch information
adumesny authored Jun 13, 2024
2 parents b057075 + b302c57 commit ca007ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dd-draggable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
/** @internal call when keys are being pressed - use Esc to cancel, R to rotate */
protected _keyEvent(e: KeyboardEvent): void {
const n = this.el.gridstackNode as GridStackNodeRotate;
if (!n) return;
if (!n?.grid) return;
const grid = n.grid;

if (e.key === 'Escape') {
Expand Down

0 comments on commit ca007ad

Please sign in to comment.