fix(Form): parent not getting dirty after nested field is changed#6545
fix(Form): parent not getting dirty after nested field is changed#6545rdjanuar wants to merge 6 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR updates the Form component's Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
| if (dirtyFields.size > 0) return true | ||
|
|
||
| for (const form of nestedForms.value.values()) { | ||
| if ((form.api.dirty as any).value) return true |
There was a problem hiding this comment.
Do we really need this as any cast? 🤔
| if ((form.api.dirty as any).value) return true | |
| if (form.api.dirty.value) return true |
027f153 to
ab758a9
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/components/Form.spec.ts`:
- Around line 576-577: The test is triggering a change event without awaiting
it, which can cause async flakiness; update the test so the call to
nestedInput.trigger('change') is awaited (i.e., use await
nestedInput.trigger('change')) before calling flushPromises() to ensure the
event is fully dispatched and Vue reactivity runs; locate the trigger call on
the nestedInput element in the Form.spec.ts test and add the await.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1bac78ba-b8db-44f8-8d2d-3ad8bc17d659
📒 Files selected for processing (2)
src/runtime/components/Form.vuetest/components/Form.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/runtime/components/Form.vue
…it trigger events in tests
🔗 Linked issue
Resolves #5144
❓ Type of change
📚 Description
📝 Checklist