Repository navigation
feat(Popup): 移动端新增可选 maxWidth 属性 - #4512
Open
Huuyii-sleeping wants to merge 1 commit into
Open
Huuyii-sleeping wants to merge 1 commit into
Huuyii-sleeping wants to merge 1 commit into
Conversation
Huuyii-sleeping
requested review from
HaixingOoO,
NWYLZW,
RylanBot,
ZWkang,
anlyyao,
carolin913,
honkinglin and
uyarn
as code owners
November 30, 2026 11:43
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 这个 PR 的性质是?
🔗 相关 Issue
关联 Tencent/tdesign-common#2743。
按维护者的迁移要求,将 tdesign-mobile-react#1020 重提到本仓库的
packages/mobile-components,后续以本 PR 为准。配套 common 样式 Tencent/tdesign-common#2791、API 源定义 TDesignOteam/tdesign-api#1074 已合入,Mobile Vue 实现 Tencent/tdesign-mobile-vue#2414 也已合入;小程序/UniApp 实现见 Tencent/tdesign-miniprogram#4742。
💡 需求背景和解决方案
宽屏设备中的顶部、底部 Popup 可以通过可选
maxWidth?: string | number限制宽度。数字按 px 处理,字符串支持 CSS 长度和none。参数无默认值,不传时不限制最大宽度,默认全宽;仅 top/bottom 生效。本 PR 只改
packages/mobile-components/popup下五个文件,迁移原 PR 的最终方案:__tests__/popup.test.tsx,不单开测试文件,不新增官网示例;defaultProps 无需改动。集成依赖:请同步最新 common。 当前 develop 的
packages/common指向d3cfc0ea,早于已合入的 common#2791 和后续 #2806。顶部/底部基础类的居中样式位于这些 common 提交中;本 PR 不修改子模块指针。本地已加载最新上游 common 验证。较窄自定义 width 的 top/bottom 弹层会随基础样式统一居中。以下为迁移后的实际 Popup 源码及移动端构建 CSS,在 1024px Chrome 模拟视口中的截图:
✅ 验证
packages/mobile-components/popup/__tests__/popup.test.tsx:29 项通过。tsc -p tsconfig.mobile.build.json --noEmit、修改源代码 ESLint(零警告)/Prettier、git diff --check通过。生成 Markdown 保持生成器格式。📝 更新日志
tdesign-react
无改动。
@tdesign-react/chat
无改动。
tdesign-mobile-react
☑️ 请求合并前的自查清单