Skip to content

fix(table): trigger @row-edit event when updateEditedCellValue updates multiple columns#6346

Closed
Copilot wants to merge 6 commits intodevelopfrom
copilot/fix-row-edit-trigger-issue
Closed

fix(table): trigger @row-edit event when updateEditedCellValue updates multiple columns#6346
Copilot wants to merge 6 commits intodevelopfrom
copilot/fix-row-edit-trigger-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 13, 2026

The @row-edit event was not triggered when updateEditedCellValue was called with isUpdateCurrentRow: true to programmatically update multiple columns. Direct user edits triggered the event correctly, but programmatic updates were silent.

// Status change triggers @row-edit for status column
// but NOT for letters column updated via updateEditedCellValue
edit: {
  component: Select,
  on: ({ updateEditedCellValue }) => ({
    onChange: () => {
      updateEditedCellValue({
        isUpdateCurrentRow: true,
        letters: [], // This update was silent
      });
    },
  }),
}

Changes

Modified packages/components/table/primary-table.tsx:

  • Created onUpdateEditedCellWithEvent wrapper that intercepts update-edited-cell events
  • For each updated column, triggers @row-edit with complete context including:
    • Column definition (recursively searches nested columns)
    • Complete editedRow from editedFormData with all accumulated edits
    • Validated rowIndex (skips if row not found)
    • colIndex from top-level array (-1 for nested columns)
  • Destructured editedFormData from useEditableRow hook to access complete row state

The event now fires consistently whether cells are updated through direct user input or programmatic updateEditedCellValue calls.

Original prompt

This section details on the original issue you should resolve

<issue_title>[table] updateEditedCellValue方法不会触发@row-edit</issue_title>
<issue_description>### tdesign-vue-next 版本

1.11.3

重现链接

No response

重现步骤

例如:

<t-table @row-edit="onRowEdit">

columns配置中的一项为:
{
  colKey: 'column1',
  edit: {
      on: ({
          updateEditedCellValue
      }) => ({
          onChange: (e) => {
              if (e.editedRow.column1 == "custom") {
                  updateEditedCellValue({
                      isUpdateCurrentRow: true,
                      column2: "someValue"
                  });
              }
          },
      }),
  }
}

column1的变化会触发@row-edit
编辑行的column2可以正确赋值,但不会触发@row-edit

期望结果

updateEditedCellValue可以触发@row-edit事件

实际结果

No response

框架版本

3.2.31

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits January 13, 2026 13:46
Co-authored-by: Wesley-0808 <69622989+Wesley-0808@users.noreply.github.com>
Co-authored-by: Wesley-0808 <69622989+Wesley-0808@users.noreply.github.com>
…nested columns

Co-authored-by: Wesley-0808 <69622989+Wesley-0808@users.noreply.github.com>
Co-authored-by: Wesley-0808 <69622989+Wesley-0808@users.noreply.github.com>
Co-authored-by: Wesley-0808 <69622989+Wesley-0808@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix updateEditedCellValue not triggering @row-edit event fix(table): trigger @row-edit event when updateEditedCellValue updates multiple columns Jan 13, 2026
Copilot AI requested a review from Wesley-0808 January 13, 2026 14:05
@uyarn uyarn closed this Apr 12, 2026
@uyarn uyarn deleted the copilot/fix-row-edit-trigger-issue branch April 12, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[table] updateEditedCellValue方法不会触发@row-edit

3 participants