fix(components): center aspectFit images horizontally - #19491
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. Walkthrough
ChangesaspectFit 居中行为
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This H5-only change horizontally centers narrow aspectFit images while preserving the existing image mode contract and adds regression coverage; no actionable merge-blocking risk remains. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
这个 PR 做了什么? (简要描述所做更改)
修复 H5
Image mode="aspectFit"只进行垂直居中、窄图在容器内水平贴左的问题。.taro-img__mode-aspectfit增加left: 50%translate(-50%, -50%)实现水平和垂直双轴居中Fixes #19463
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台:
验证:
pnpm -r --aggregate-output --filter '@tarojs/taro-h5...' --if-present prodpnpm exec eslint packages/taro-components/__tests__/image.e2e.tspnpm exec stencil test --spec --ci -i --coverage --silent --no-build(70 suites、106 tests、35 snapshots)pnpm exec stencil test --e2e --ci --no-build image.e2e.ts -i回归用例在修复前失败(容器水平中心为 32px,图片水平中心为 16px),应用修复后通过。
Summary by CodeRabbit
Bug 修复
aspectFit模式时的水平居中问题。测试
aspectFit模式下的居中表现。