-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Git diff list uses the perfect scroll bar now. #6085
Conversation
} | ||
|
||
focus(): void { | ||
if (this.listContainer) { | ||
this.listContainer.focus(); | ||
} | ||
} | ||
|
||
getListContainer(): HTMLDivElement | undefined { |
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.
unused
@@ -67,6 +69,10 @@ export class GitDiffWidget extends GitNavigableListWidget<GitFileChangeNode> imp | |||
})); | |||
} | |||
|
|||
protected getScrollContainer(): MaybePromise<HTMLElement> { | |||
return new Promise(resolve => this.fileChangeListContainerIsReady = resolve); |
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.
please use the Deferred
from @theia/core/lib/common/promise-util
for such cases
} | ||
|
||
componentDidUpdate(): void { | ||
this.props.onListContainerReady(this.listContainer); |
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.
Q: does it actually change?
} | ||
})(); | ||
} | ||
|
||
protected onResize(msg: Widget.ResizeMessage): void { | ||
super.onResize(msg); | ||
this.update(); |
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.
👍
@@ -413,11 +428,20 @@ export class GitDiffListContainer extends React.Component<GitDiffListContainer.P | |||
|
|||
componentDidMount(): void { | |||
this.props.addDiffListKeyListeners(this.props.id); | |||
this.props.onListContainerReady(this.listContainer); |
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.
WDYT of renaming onListContainerReady
–> setListContainer
? onSomething
sounds like an event handler.
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.
Sounds good.
please get rid of commits fixing issues in the original commit |
beccff1
to
0df0d95
Compare
@AlexTugarev and @akosyakov : thanks for reviewing and the hints. |
0df0d95
to
bbd36d6
Compare
Signed-off-by: Jan Bicker <[email protected]>
bbd36d6
to
026fd51
Compare
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.
Worked perfect for me!
Thanks!
What it does
The ListContainer of the GitDiff View uses the PerfectScrollbar instead of the browser native scrollbar now.
It fixes also an error which caused that sometimes, after resizing vertically, elements at the lower end weren't selectable anymore.
See gitpod-io/gitpod#757
How to test
Use a repository where are enough different files between two branches and use the Git Diff command to open these changes.
The scrollbar of the git diff widget should show the same scrollbar in all browsers.
All elements should be selectable even after resizing.
Review checklist
Reminder for reviewers