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: Can't copy text with control + c when Table has selectable rows #5757

Closed
felldo opened this issue May 17, 2024 · 0 comments · Fixed by #5759
Closed

DataTable: Can't copy text with control + c when Table has selectable rows #5757

felldo opened this issue May 17, 2024 · 0 comments · Fixed by #5759
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@felldo
Copy link

felldo commented May 17, 2024

Describe the bug

When selecting a row, when i.e. single selection mode is active, you can not copy the content of the cell.

<template>
  <DataTable :value="products" v-model:selection="selectedRows" selection-mode="single">
    <Column field="code" header="Code"></Column>
    <Column field="name" header="Name"></Column>
  </DataTable>
  {{selectedRowssss}}
</template>

<script setup>
import {ref} from 'vue';
const selectedRows = ref();
const products = ref([
  {
    code: '1',
    name: 'one'
  },
  {
    code: '2',
    name: 'two'
  }
]);
</script>

Reproducer

See description

PrimeVue version

3.52.0

Vue version

3.x

Language

TypeScript

Build / Runtime

Nuxt

Browser(s)

No response

Steps to reproduce the behavior

  1. Use the code in the description
  2. Select a row
  3. Double-click a value, for example two in the column Name
  4. Press control + c
  5. The content will NOT be copied
  6. The content can be copied by selecting the content and then mouse right click -> copy

Expected behavior

The content will be copied when selecting a value in the DataTable and pressing control + c while the DataTable is in
selection-mode single

@felldo felldo added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 17, 2024
@tugcekucukoglu tugcekucukoglu added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 3, 2024
@tugcekucukoglu tugcekucukoglu added this to the 3.53.0 milestone Jun 3, 2024
tugcekucukoglu pushed a commit that referenced this issue Jun 3, 2024
…#5759)

* fix: allow control c key

* fix: prevent all text select when MultipleSelectionMode

* fix: prevent text all select when select mode

* fix: blocks event only it is not copy shortcut.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants