Skip to content

drag and drop bugs #52

@Loveiuer

Description

@Loveiuer

Bug description:When there are two items with the same y value but different h values, dragging the item with the larger h value will also move the item with the smaller h value

Reproduce information about this bug:
Version: latest
Code:

<script setup lang="ts">
import { reactive } from 'vue'
import { GridLayout } from 'grid-layout-plus'

const layout = reactive([
  { x: 0, y: 0, w: 12, h: 1, i: '0' },
  { x: 0, y: 1, w: 4, h: 4, i: '1' },
  { x: 4, y: 1, w: 4, h: 2, i: '2' },
])
</script>

<template>
  <div style="margin-top: 10px">
    <h4>Grid</h4>
    <GridLayout :layout="layout" :row-height="30">
      <template #item="{ item }">
        <span class="text">{{ item.i }}</span>
      </template>
    </GridLayout>
  </div>
</template>

<style scoped>
.vgl-layout {
  background-color: #eee;
}

:deep(.vgl-item:not(.vgl-item--placeholder)) {
  background-color: #ccc;
  border: 1px solid black;
}

:deep(.vgl-item--resizing) {
  opacity: 90%;
}

:deep(.vgl-item--static) {
  background-color: #cce;
}

.text {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: auto;
  font-size: 24px;
  text-align: center;
}
</style>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions