-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Handle tabbing to links in hovers #163879
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.
Do you know how this problem is solved in the editor?
private readonly _hover: HoverWidget = this._register(new HoverWidget()); |
Would be good to consolidate so they both do the same thing
|
@@ -443,6 +434,22 @@ export class HoverWidget extends Widget { | |||
} | |||
} | |||
|
|||
private adjustHoverMaxHeight(target: TargetRect): void { | |||
let maxHeight = 250; |
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.
There's probably a better starting value than this, especially for larger screens.
@@ -443,6 +434,22 @@ export class HoverWidget extends Widget { | |||
} | |||
} | |||
|
|||
private adjustHoverMaxHeight(target: TargetRect): void { | |||
let maxHeight = 250; |
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.
This is solving a different tracked issue, right? I think it should be out of scope of this PR as it will need more discussion, in particular I always thought that we would need to integrate a DomScrollableElement
.
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.
This hoverWidget contains a base hoverWidget which has such an element. It's just that this hoverWidget clears out the maxHeight at https://github.com/microsoft/vscode/blob/main/src/vs/workbench/services/hover/browser/hoverWidget.ts#L231
And here's where this hoverWidget imports the other one that has the scrollbar https://github.com/microsoft/vscode/blob/main/src/vs/workbench/services/hover/browser/hoverWidget.ts#L14
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.
That pixel high might cause problems in some scenarios though, and it would need to be tested to make sure the hover correctly flips when real estate isn't there
if (e.key !== 'Tab') { | ||
this.hideHover(); | ||
} |
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.
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.
Actually, being able to tab into the hover seems pretty good, because I'm not sure how else a user would think to use the keyboard to navigate into the hover
I also think that a tab loop might help, though that is a more complicated design. I can split the maxHeight changes into a separate PR.
Closing in favour of #166657 |
Ref #159088