-
Notifications
You must be signed in to change notification settings - Fork 321
fix(grid): [grid] fix repeated trigger cell active when boardConfig.isEdit is set true #2770
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
Conversation
WalkthroughThe pull request introduces modifications to the grid component's key event handling in Vue. The changes focus on improving the behavior of cell editing interactions by adjusting how non-functional key presses are processed. Specifically, the modifications prevent automatically clearing cell values and add more precise conditions for triggering edit modes, enhancing the grid's interaction logic. Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Walkthrough此PR修复了当 Changes
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/vue/src/grid/src/table/src/utils/handleGlobalKeydownEvent.ts (1)
104-104
: Translate comment to English for consistency.Consider translating the Chinese comment to English:
-// 如果同一个单元格已经被激活编辑态,那么就不重复触发 +// Skip triggering if the same cell is already in edit mode
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/vue/src/grid/src/table/src/events.ts
(0 hunks)packages/vue/src/grid/src/table/src/utils/handleGlobalKeydownEvent.ts
(2 hunks)
💤 Files with no reviewable changes (1)
- packages/vue/src/grid/src/table/src/events.ts
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: PR E2E Test (pnpm test:e2e3)
- GitHub Check: PR Unit Test
🔇 Additional comments (4)
packages/vue/src/grid/src/table/src/utils/handleGlobalKeydownEvent.ts (4)
103-103
: LGTM! Parameter addition aligns with other rules.The addition of the
actived
parameter torule10
follows the established pattern used in other rules and is necessary for the fix.
106-107
: LGTM! Fix prevents repeated edit mode triggers.The added condition
!(selected.row === actived.row && selected.column === actived.column)
effectively prevents re-triggering edit mode when a cell is already active, directly addressing the reported issue.
152-152
: LGTM! Parameter correctly passed to modified function.The
actived
parameter is properly passed torule10
, maintaining consistency with the function signature change.
103-107
: Verify similar patterns in other grid components.Let's verify if there are other places in the codebase that might need similar fixes to prevent repeated triggers.
✅ Verification successful
✓ Fix is complete and correctly isolated
The protection against repeated triggers is specific to keyboard-driven edit mode and is correctly implemented in the only relevant location. Other cell activation flows have their own appropriate protection mechanisms.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for similar patterns in other grid-related files # Look for edit mode triggers that might need the same fix # Search for similar rule definitions rg -l "keyboardConfig.isEdit" "packages/vue/src/grid" # Search for cell activation patterns ast-grep --pattern 'selected.$_ === actived.$_' 'packages/vue/src/grid'Length of output: 387
Script:
#!/bin/bash # Search for other keyboard event handlers and edit mode triggers rg -l "isEdit|editConfig" "packages/vue/src/grid" # Look for any cell activation logic ast-grep --pattern 'function $_($_) { $$$ actived.$_ $$$ }'Length of output: 1126
Script:
#!/bin/bash # Check implementation details in related files rg "isEdit.*actived" --type ts packages/vue/src/grid -C 3 # Look for similar cell state comparisons rg "selected\.(row|column).*actived\.(row|column)" --type ts packages/vue/src/grid -C 3 # Check cell activation handlers cat packages/vue/src/grid/src/edit/src/utils/handleActived.tsLength of output: 5999
…sEdit is set true (#2770) * fix(grid): [grid] fix repeated trigger cell active when boardConfig.isEdit is set true * fix(grid): [grid] fix value to be set null when keyboard enter edit
…sEdit is set true (#2770) * fix(grid): [grid] fix repeated trigger cell active when boardConfig.isEdit is set true * fix(grid): [grid] fix value to be set null when keyboard enter edit
PR
修复当配置了boardConfig.isEdit为true时,激活编辑被一直重复触发

PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
close #2321
Summary by CodeRabbit