Happy-Coding-Clans / vue-easytable

A powerful data table based on vuejs. You can use it as data grid、Microsoft Excel or Google sheets. It supports virtual scroll、cell edit etc.
https://happy-coding-clans.github.io/vue-easytable/
MIT License
3.63k stars 725 forks source link

[Bug Report] Still can delete cell with Delete key from Keyboard in cell that read only #573

Closed hindarwan closed 11 months ago

hindarwan commented 1 year ago

I am opening an issue for

vue-easytable

Issue Type

Bug

Issue Title

Still can delete with Delete key from Keyboard in cell that readonly

library Version

v2.27.0

Vue Type

2

Browser Type

Edge 112.0.1722.48

System version

Windows 11

Reproduction url

https://happy-coding-clans.github.io/vue-easytable/#/en/doc/table/cell-edit?anchor=basic-usage

Step to reproduce

  1. Go to this documentation page: https://happy-coding-clans.github.io/vue-easytable/#/en/doc/table/cell-edit?anchor=basic-usage
  2. Click on column 'Name' row number '1' that contain text 'You can't edit'.
  3. Press Delete key from Keyboard

What is expected?

Text in that cell not deleted.

What is actually happening?

Text in that cell deleted.

M-jiale commented 1 year ago

不可以edit的单元格 可以被ctrl+v 复制内容填充,只读单元格是否可以去除其他外在操作!

huangshuwei commented 1 year ago

Sorry, this is a conflict between the editing function and the clipboard function. You can temporarily solve this problem through the beforePaste, beforeCut, and beforeDeletefunctions of the clipboardOption. Refer to api:https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/clipboard?anchor=api

hindarwan commented 11 months ago

You can temporarily solve this problem through the beforePaste, beforeCut, and beforeDeletefunctions of the clipboardOption. Refer to api:https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/clipboard?anchor=api

Nice, it solve this problem. Thanks