Skip to content
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

Anchor offsetTop issue #4706

Closed
froston opened this issue Jan 24, 2017 · 7 comments · Fixed by #4817
Closed

Anchor offsetTop issue #4706

froston opened this issue Jan 24, 2017 · 7 comments · Fixed by #4817
Assignees

Comments

@froston
Copy link

froston commented Jan 24, 2017

  • antd version: 2.5.2
  • Browser and its version: ie 11, chrome 55, firefox 50

Links of Anchor are scrolling to wrong position.

I'm using a div as a top bar which has position fixed and height 50px. All the content is margined from top by 50 px.
This seems to make the issue with Anchor's links. They are scrolling to wrong position 50 pixels down. I tried to set offsetTop property to Anchor component but makes no difference.

@RaoHai
Copy link
Contributor

RaoHai commented Jan 25, 2017

could you please offer a reproducible online demo for us?

http://codepen.io/benjycui/pen/KgPZrE?editors=001

@RaoHai RaoHai self-assigned this Jan 25, 2017
@froston
Copy link
Author

froston commented Jan 25, 2017

@FacundoGFlores
Copy link

Hi there. I am having the same issue.

@afc163
Copy link
Member

afc163 commented Feb 8, 2017

@RaoHai

RaoHai added a commit to RaoHai/ant-design that referenced this issue Feb 9, 2017
 + close ant-design#4706
 + `<Anchor offset={x} />` will calculate target position correctly.
ddcat1115 pushed a commit that referenced this issue Feb 10, 2017
+ close #4706
 + `<Anchor offset={x} />` will calculate target position correctly.
@FacundoGFlores
Copy link

Problem solved! Thank you very much!

@froston
Copy link
Author

froston commented Feb 17, 2017

cool .. works! thanks a lot

@lock
Copy link

lock bot commented May 2, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants