fix(components): center aspectFit images horizontally - #19491
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. Walkthrough
ChangesaspectFit 居中行为
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19491 +/- ##
========================================
Coverage 54.55% 54.55%
========================================
Files 463 463
Lines 25349 25349
Branches 6323 6324 +1
========================================
+ Hits 13829 13830 +1
- Misses 9509 9636 +127
+ Partials 2011 1883 -128
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
2721205 to
9983f09
Compare
9983f09 to
c88a2e9
Compare
这个 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模式下的居中表现。