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

Scroll to component button #478

Merged
merged 3 commits into from Jan 12, 2018
Merged

Conversation

Akryum
Copy link
Member

@Akryum Akryum commented Dec 23, 2017

Fix #235

  • Scroll to component button in Component tree
  • Center the instance to the middle of the screen
  • Added some routing to target page

vue-devtools-scroll-instance

@@ -587,7 +591,7 @@ function processObservables (instance) {
function scrollIntoView (instance) {
const rect = getInstanceRect(instance)
if (rect) {
window.scrollBy(0, rect.top)
window.scrollBy(0, rect.top + (rect.height - window.innerHeight) / 2)
Copy link
Member

@posva posva Jan 7, 2018

Choose a reason for hiding this comment

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

making it appear in the middle of the screen is pretty neat actually, It did bother me sometimes (toolbars haha) when it scrolls to the very top

Choose a reason for hiding this comment

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

haha it's exactly why I came across this because clicking on a component makes it auto scroll to the top (and behind my fixed navigation).
Not sure how to change this though (and I feel like it's a new change?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure how to change this though (and I feel like it's a new change?)

What do you mean? 😕

Choose a reason for hiding this comment

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

We have a component that's often taller then the screen, so when it scrolls to the middle, it's a bit odd. It would be good to scroll to middle for smaller components, but scroll to top for components taller than the screen height.

@yyx990803 yyx990803 merged commit 96f532f into vuejs:master Jan 12, 2018
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 this pull request may close these issues.

None yet

6 participants