fix(runtime-dom): preserve textarea resize dimensions#14747
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded a test and changed the runtime-dom style patcher: null/undefined style values are cleared explicitly, and textarea-specific logic now skips reapplying width/height when the incoming string equals the previous value to avoid overwriting user-resized dimensions. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/runtime-dom/__tests__/patchStyle.spec.ts (1)
45-76: Add adisplay+v-showregression case.The new object-style coverage is solid, but it still doesn't pin the
displaybypass inpatchStyle()whenvShowOriginalDisplayis present. A small unchanged-style case around{ display: 'block' }would keep that branch from regressing silently.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/runtime-dom/__tests__/patchStyle.spec.ts` around lines 45 - 76, Add a test in patchStyle.spec.ts that covers the v-show/display bypass: create an element, set its style.display (e.g., 'block') and set the v-show marker (vShowOriginalDisplay, typically el._vod) to simulate v-show state, then call patchProp(el, 'style', null, { display: 'block' }) followed by patchProp(el, 'style', value, value) where the object is unchanged; assert that the element's display is not overwritten (respects the v-show bypass). This targets the patchStyle/patchProp behavior when vShowOriginalDisplay is present to prevent regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/runtime-dom/__tests__/patchStyle.spec.ts`:
- Around line 45-76: Add a test in patchStyle.spec.ts that covers the
v-show/display bypass: create an element, set its style.display (e.g., 'block')
and set the v-show marker (vShowOriginalDisplay, typically el._vod) to simulate
v-show state, then call patchProp(el, 'style', null, { display: 'block' })
followed by patchProp(el, 'style', value, value) where the object is unchanged;
assert that the element's display is not overwritten (respects the v-show
bypass). This targets the patchStyle/patchProp behavior when
vShowOriginalDisplay is present to prevent regressions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ab1078d8-2d8a-410b-a4dd-c062aae14cbf
📒 Files selected for processing (2)
packages/runtime-dom/__tests__/patchStyle.spec.tspackages/runtime-dom/src/modules/style.ts
7c43a49 to
84b49b9
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/runtime-dom/src/modules/style.ts`:
- Around line 50-65: The current check `if (value != null)` skips null/undefined
style entries and lets stale inline styles persist; update the logic in the loop
in modules/style.ts so that when `value` is nullish you explicitly clear the
inline style (e.g. call `setStyle(style, key, '')` or otherwise remove the
style) and still update `nextCache[key]` (recording the cleared state) instead
of making it a no-op—keep the existing conditional call to
`shouldPreserveTextareaResizeStyle(el, key, cachedStyle && cachedStyle[key],
value)` but ensure nullish values go through the removal path; reference `next`,
`key`, `value`, `nextCache`, `cachedStyle`, `setStyle`, and
`shouldPreserveTextareaResizeStyle` to locate where to change the behavior.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 99c0afc0-58fa-472f-b448-c6bf17344f92
📒 Files selected for processing (2)
packages/runtime-dom/__tests__/patchStyle.spec.tspackages/runtime-dom/src/modules/style.ts
✅ Files skipped from review due to trivial changes (1)
- packages/runtime-dom/tests/patchStyle.spec.ts
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
close #14741
Summary by CodeRabbit
Bug Fixes
Tests