diff --git a/src/Grid.vue b/src/Grid.vue index 8b9d4cd0853a16f71d9d65f8f73c4ab39fb52ee1..f5cdbe4c9b69cc7cd5062bf9d88d508dd12eeca4 100644 --- a/src/Grid.vue +++ b/src/Grid.vue @@ -44,6 +44,10 @@ export default { }, methods: { positionAllowed(x, y, key) { + if (x < 0 || y < 0) return false; + if (x > this.cols) return false; + if (y > this.rows) return false; + for (let item of this.items) { if (key === item.key) continue; if (x >= item.x && x < item.x + item.w) {