ruilisi/fortune-sheet

粘贴修改单元格数据后没执行 hooks.afterUpdateCell 方法

Opened this issue · 2 comments

代码:

<Workbook
  hooks={{
    afterUpdateCell:(r,c,o,n)=>{
      //do something
    }
  }}
/>

场景:输入修改单元格数据时会执行 afterUpdateCell 方法,但是粘贴进这个单元格时不会执行afterUpdateCell这个方法。
Scenario: The afterUpdateCell method is executed when input changes cell data, but the afterUpdateCell method is not executed when pasting into the cell.

预期:不确定是否为bug,我认为粘贴修改了单元格数据后 也执行afterUpdateCell方法比较合理。同理还有beforeUpdate
Expectations: Not sure if it's a bug, I think it's reasonable to do afterUpdateCell after pasting and modifying the cell data. Same with beforeUpdate.

there is a slight issue in adding these to paste, because afterUpdateCell and beforeUpdateCell expect row and col of the cels, while the paste operation works on a selection range. only way i can think of is to call these hooks multiple times individually for each cell update but it does not sound that good to me.