-
Notifications
You must be signed in to change notification settings - Fork 353
feat: onRowAppended and onColumnAppended #1062
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
feat: onRowAppended and onColumnAppended #1062
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for column-appending alongside existing row-appending in both the core component and test harness, and updates API exports and selection behavior for trailing rows.
- Introduce
onColumnAppended
callback andappendColumn
method inDataEditor
. - Extend test utilities (
EventedDataEditor
) to simulate appended columns and add corresponding tests. - Export
emptyGridSelection
and adjust trailing-row logic to be driven bytrailingRowOptions
.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/core/test/test-utils.tsx | Added extraCols state, onColumnAppended hook, and updated props in EventedDataEditor |
packages/core/test/data-editor.test.tsx | New tests for appendRow without a trailing row and for appendColumn via ref |
packages/core/src/index.ts | Exported emptyGridSelection |
packages/core/src/data-editor/data-editor.tsx | Added onColumnAppended prop, implemented appendColumn , and updated selection/movement logic |
Comments suppressed due to low confidence (2)
packages/core/test/test-utils.tsx:280
- [nitpick] The variable name
c
is ambiguous; consider renaming it tocol
for clarity.
const [c] = cell;
packages/core/src/data-editor/data-editor.tsx:709
- The JSDoc for
appendColumn
documentsrow
but omits theopenOverlay
parameter. Add@param openOverlay
to keep the documentation in sync with the signature.
* @param row The row index to focus in the new column.
I was able to test the new |
Tab works to go right; shift-tab to go left. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
* feat: onRowAppended and onColumnAppended * fix onRowAppended spelling * fix: fallback to updateSelectedCell if onRowAppended or onColumnAppended not defined * fix spelling in changelog * docs: appendColumn and onColumnAppended
onColumnAppended
functiononRowAppended
to be called without trailingRow when new selection would move it beyond row limit