-
Notifications
You must be signed in to change notification settings - Fork 35.7k
reset scroll position core #132013
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
reset scroll position core #132013
Conversation
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.
I only looked at pickerQuickAccess.ts
| const removed = items.splice(index, 1); | ||
| const activeItems = input.activeItems.filter((ai) => ai !== removed[0]); | ||
| const resetScrollPositionBefore = input.resetScrollPosition; | ||
| input.resetScrollPosition = false; |
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.
It still resets when you remove the item?
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.
Yes because all it's doing is setting items which triggers an update which triggers the reset of the scroll position.
| } | ||
|
|
||
| get scrollTop() { | ||
| return this.list.scrollTop; |
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.
Unsure about the list-widget but for the tree there is getViewState which captured scroll position and selection. I happily use that for the outline when switching between editors - might be an option for the list too...
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.
I didn't see a getViewState equivalent in my look around the list-widget but good to know!
|
|
||
| autoFocusOnList: boolean; | ||
|
|
||
| resetScrollPosition: boolean; |
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.
For the API, I would turn this around because default values are never true
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.
flipped it around and called it keepScrollPosition: boolean
Adds a new property to quick picks called:
resetScrollPosition: booleanwhich defaults to
truethat controls whether or not the cursor position will be reset to the top when either
itemsoractiveItemsare changed.This PR fixes #109969