Skip to content

[DatetimePicker] Fix defaultValue & sync demo example#238

Merged
ickg5 merged 2 commits into
taroify:mainfrom
Brain777777:fix/dateTimePicker
Jan 6, 2022
Merged

[DatetimePicker] Fix defaultValue & sync demo example#238
ickg5 merged 2 commits into
taroify:mainfrom
Brain777777:fix/dateTimePicker

Conversation

@Brain777777

Copy link
Copy Markdown
Contributor

No description provided.

@ickg5

ickg5 commented Jan 5, 2022

Copy link
Copy Markdown
Contributor

这是个什么问题?大神

@Brain777777

Copy link
Copy Markdown
Contributor Author

这是个什么问题?大神

修复在未设置 value 但设置 defaultValue 无效 Bug , 原因是 DatetimePicker 组件内部 clampDate 函数做了非空处理导致未传递 value 最终也是有值的,但到了 useState hook 内部有对 value 做了非空处理并提升了优先级最终导致设置 defaultValue 失效

@ickg5
ickg5 merged commit e526992 into taroify:main Jan 6, 2022
@Brain777777
Brain777777 deleted the fix/dateTimePicker branch January 25, 2022 01:52
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