Skip to content

fix(rn): update Picker component and implement tests#2542

Open
wangshunnn wants to merge 13 commits into
masterfrom
fix-rn-picker-range-prop
Open

fix(rn): update Picker component and implement tests#2542
wangshunnn wants to merge 13 commits into
masterfrom
fix-rn-picker-range-prop

Conversation

@wangshunnn

@wangshunnn wangshunnn commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Fix (Picker)

  • 修复 RN pickerrange 未正常透传导致的内容空白问题(原因:之前 fix: 过滤小程序属性,避免直接透传给rn组件 #2507 错误删除了 range 属性)。

  • 支持 picker 动态更新选项数据,在外部 range 变化后再次打开弹层时,会刷新弹层内容,避免展示旧数据。

  • 补齐 RN picker 触发区域文本样式透传能力,使 colorfontSize 等样式能作用到子节点,表现更接近小程序。

@wangshunnn wangshunnn changed the title fix(rn): add range prop to Picker component and implement tests fix(rn): update Picker component and implement tests Jul 6, 2026
@hiyuki

hiyuki commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

和其他基础组件拉齐处理backgroundStyle以及hasPositionFixed

测试确认innerProps是否需要传如picker content中

@hiyuki

hiyuki commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

showPicker 里会先 renderPickerContent() 再立刻 updatePickerContent(),首次打开等于 open 后又 update 一次同样内容。功能没坏,但有点多余。可以改成:已 open 时只 update,未 open 时 open。

@wangshunnn

Copy link
Copy Markdown
Collaborator Author

和其他基础组件拉齐处理backgroundStyle以及hasPositionFixed

测试确认innerProps是否需要传如picker content中

已修复

@wangshunnn

Copy link
Copy Markdown
Collaborator Author

showPicker 里会先 renderPickerContent() 再立刻 updatePickerContent(),首次打开等于 open 后又 update 一次同样内容。功能没坏,但有点多余。可以改成:已 open 时只 update,未 open 时 open。

已修复

const openPickerContent = () => {
const renderPickerModal = getPickerContent()
if (!renderPickerModal) {
return false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里返回true和false没用吧

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修复

if (!renderPickerModal) {
return
}
const contentHeight = headerText ? 350 : 310

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

headerText中途变更不会生效

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants