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

Page scrolling to anchor when content is too long #13

Open
XGhozt opened this issue Oct 9, 2018 · 7 comments
Open

Page scrolling to anchor when content is too long #13

XGhozt opened this issue Oct 9, 2018 · 7 comments

Comments

@XGhozt
Copy link

XGhozt commented Oct 9, 2018

I'm not sure if this is just on my end or not. This should be disabled though. There's no need to scroll the page to the anchor when switching tabs. This is just the default behavior when clicking links with anchors.

@shabbirbharmal
Copy link
Contributor

That's right, it is just default behavior.

@XGhozt
Copy link
Author

XGhozt commented Oct 10, 2018

@shabbirbharmal -- Yes, but it should be disabled. Why did you close this?

https://vuejs.org/v2/guide/events.html

event.stopPropagation()

@shabbirbharmal
Copy link
Contributor

Because that is the default behavior of tab component I am using and I didn't see any option to change it or make it configurable. Let me know if you think we are not on the same page with the issue you are facing.

@XGhozt
Copy link
Author

XGhozt commented Oct 10, 2018

It doesn't need to be a configurable option. The page simply shouldn't move at all when you change tabs. Just like most other websites. A good example is github right here when you add a reply, there is a "Write" and "Preview" tab on the editor. The page doesn't scroll.

If the page moves when users are clicking a tab, it's very disorienting and the first thing they will do is scroll back up. I'm not familiar enough with Vue or Nova to get this installed. Bust in native javascript or any other library it's usually a one liner added to the click event to disable the browsers default behavior.

@XGhozt
Copy link
Author

XGhozt commented Oct 10, 2018

Is this what you're using?

https://github.com/spatie/vue-tabs-component

It doesn't happen in the demo on that website.
Can you confirm it's happening in your Laravel Nova installation, too?

Demo: http://vue-tabs-component.spatie.be/

  • Make your window smaller to confirm no scrolling happens.

@shabbirbharmal
Copy link
Contributor

I see what is happening here. URL fragment is conflicting with Nova's Vue router. Will have to disable URL fragment to fix this

@XGhozt
Copy link
Author

XGhozt commented Oct 11, 2018

Awesome, hopefully it's not to difficult.

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 a pull request may close this issue.

2 participants