Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca007ad

Browse files
authored
Merge pull request #2698 from adrianbenjuya/master
Bugfix: prevent throwing error when node.grid is undefined (drag item from outside the grid)
2 parents b057075 + b302c57 commit ca007ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dd-draggable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
280280
/** @internal call when keys are being pressed - use Esc to cancel, R to rotate */
281281
protected _keyEvent(e: KeyboardEvent): void {
282282
const n = this.el.gridstackNode as GridStackNodeRotate;
283-
if (!n) return;
283+
if (!n?.grid) return;
284284
const grid = n.grid;
285285

286286
if (e.key === 'Escape') {

0 commit comments

Comments
 (0)