New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Anchor): add targetOffset prop #17827
feat(Anchor): add targetOffset prop #17827
Conversation
Deploy preview for ant-design ready! Built with commit 4968052 |
@zombieJ Please check this PR |
Codecov Report
@@ Coverage Diff @@
## feature #17827 +/- ##
==========================================
Coverage ? 96.04%
==========================================
Files ? 268
Lines ? 7457
Branches ? 2073
==========================================
Hits ? 7162
Misses ? 293
Partials ? 2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## feature #17827 +/- ##
==========================================
Coverage ? 96.26%
==========================================
Files ? 280
Lines ? 7523
Branches ? 2050
==========================================
Hits ? 7242
Misses ? 279
Partials ? 2
Continue to review full report at Codecov.
|
Seems ok. Could you help to add a test case about this? |
In my see, because unexport expect(wrapper.prop('targetOffset')).toBe(some value); I think we should be split |
Here is some useful util of ( |
thank you, |
So efficiency! Could you add a demo about it and add link in |
support xThis comment was generated by todo based on a
|
|
|
我发布前改掉。 |
const frameFunc = () => { | ||
const timestamp = Date.now(); | ||
const time = timestamp - startTime; | ||
this.setScrollTop(easeInOutCubic(time, scrollTop, 0, 450)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setScrollTop
和 getCurrentScrollTop
已经没有用了,但是没删,导致测试覆盖率下降。
在这里 #18406 修复。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
我本地换了几个 node 版本单独跑了下是 OK 的 yarn test --runInBand components/anchor/__tests__/Anchor.test.js |
本地都是好的,发现换 circleci 的 image 就不行了,只有 |
是不是又和 lodash 的 debounce 有关? |
@zombieJ 不清楚,最近忙,等周末有空看看,可能是我写的 dateMock 有问题吧,主要是本地没办法复现不好测试 |
@zombieJ 自己测试了下,发现可能出现的情况
之后我改进下 |
🤔 This is a ...
🔗 Related issue link
#17663
💡 Background and solution
After fixed nav, scroll to anchor target, it's no visible.
固定导航后,滚动到锚点的目标被遮挡
📝 Changelog
targetOffset
to support customize scroll position offset.targetOffset
以支持自定义滚动偏移量。☑️ Self Check before Merge