Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable: Rows are unintentionally reorderable #6805

Open
koglerch13 opened this issue Nov 18, 2024 · 0 comments
Open

DataTable: Rows are unintentionally reorderable #6805

koglerch13 opened this issue Nov 18, 2024 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@koglerch13
Copy link

Describe the bug

Repro on Stackblitz: https://stackblitz.com/edit/dgakbc

It seems that an <a> element inside a column-template makes the DataTable appear as if it could be reordered (even if re-ordering is not explicitly configured)

Alternative Repro (if StackBlitz is not available):

<template>
  <ThemeSwitcher />
  <div class="card">
    <DataTable :value="products" tableStyle="min-width: 50rem">
      <Column>
        <template #body="slotProps">
          <a href="#">Drag this!</a>
        </template>
      </Column>
      <Column field="code" header="Code"></Column>
      <Column field="name" header="Name"></Column>
      <Column field="category" header="Category"></Column>
      <Column field="quantity" header="Quantity"></Column>
    </DataTable>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import { ProductService } from '@/service/ProductService';

onMounted(() => {
  ProductService.getProductsMini().then((data) => (products.value = data));
});

const products = ref();
</script>

Reproducer

https://stackblitz.com/edit/dgakbc?file=src%2FApp.vue

PrimeVue version

4.2.2

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

  1. Go to the StackBlitz: https://stackblitz.com/edit/dgakbc
  2. Click + Drag on any of the "Drag This" columns.

Observed
Row gets "draggable" (but never actually reorders the table)

Expected behavior

Row does not appear "draggable"

@koglerch13 koglerch13 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant