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.
改动点
添加
keepAlign
属性,当子元素移动时,是否始终保持与子元素对齐,默认为false
。解决的问题
发现在 在
rc-tooltip@3.7.3
版本及其之前版本是有这个特性的,之后版本就没有了,应该是rc-trigger
升级导致。这样以来,rc-slider
拖拽时,tooltip 就不会随着 handle 位置改变而改变(https://github.com/react-component/slider/issues/693)。在
antd
中也为 Slider 开发了这个功能,因此这次把这个功能移植到rc-tooltip
中来,顺便解决rc-slider
的问题。@afc163 @zombieJ 觉得没问题的话,我再加上测试用例。