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

fix: page scroll with URL hash redirection. #4883

Merged
merged 8 commits into from
Sep 4, 2020

Conversation

shantanumallik
Copy link
Contributor

@shantanumallik shantanumallik commented Aug 26, 2020

Fixes #4849

Short description of what this resolves:

  • Fixed the redirection based on URL hash and anchor tags. Now the anchored div relative to the URL hash shows up at the top of the screen on page load.
  • Earlier it required two clicks initially on page load to jump to a particular section of the event page using the side-menu. This was so because the first click was required to bind the anchor scroll action with the click event. It did not trigger the scroll action on the first click. Added scroll action to the first click.

Demo Links:

These links direct to the respective sections of the event page in the demo.

Checklist

  • I have read the Contribution & Best practices Guide.
  • My branch is up-to-date with the Upstream development branch.
  • The acceptance, integration, unit tests and linter pass locally with my changes

@vercel
Copy link

vercel bot commented Aug 26, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/3p2hesww1
✅ Preview: https://open-event-frontend-git-fork-shantanumallik-development.eventyay.vercel.app

@codecov
Copy link

codecov bot commented Aug 26, 2020

Codecov Report

Merging #4883 into development will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #4883      +/-   ##
===============================================
- Coverage        23.17%   23.14%   -0.04%     
===============================================
  Files              481      481              
  Lines             5096     5103       +7     
  Branches            18       18              
===============================================
  Hits              1181     1181              
- Misses            3911     3918       +7     
  Partials             4        4              
Impacted Files Coverage Δ
app/components/public/side-menu.js 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 569b948...3f6af77. Read the comment docs.

@shantanumallik
Copy link
Contributor Author

@iamareebjamal please review.

@iamareebjamal
Copy link
Member

Thanks a lot for the fix and explanation. Will review soon and revert

@iamareebjamal
Copy link
Member

When I click on Organizer, the hash should change but it isn't. If you can fix it, please do, otherwise the current behaviour is enough as well

@shantanumallik
Copy link
Contributor Author

@iamareebjamal iamareebjamal changed the title Fixed page scroll with URL hash redirection. fix: page scroll with URL hash redirection. Sep 4, 2020
@auto-label auto-label bot added the fix label Sep 4, 2020
@iamareebjamal iamareebjamal merged commit 594d156 into fossasia:development Sep 4, 2020
super.didRender();
const anchor_tag = window.location.hash;
$('html, body').animate({
scrollTop: $(anchor_tag).offset().top
Copy link
Member

Choose a reason for hiding this comment

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

Throwing Cannot read property 'top' of undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking into this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this the only error?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, mostly

@iamareebjamal
Copy link
Member

As mentioned, changes are throwing a lot of errors, hence reverting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Public Event Pages: Organizer Menu Item does not go to "Organizer Section"
2 participants